mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-25 09:41:23 +01:00
Add docs to new migration classes
This commit is contained in:
parent
c61c98ff5e
commit
b2ed43ba22
@ -4,6 +4,9 @@ import co.aikar.commands.ACFUtil;
|
|||||||
import com.dumptruckman.minecraft.util.Logging;
|
import com.dumptruckman.minecraft.util.Logging;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Single migrator action that converts a string value to a long.
|
||||||
|
*/
|
||||||
public class LongMigratorAction implements MigratorAction {
|
public class LongMigratorAction implements MigratorAction {
|
||||||
|
|
||||||
public static LongMigratorAction of(String path) {
|
public static LongMigratorAction of(String path) {
|
||||||
@ -16,6 +19,9 @@ public class LongMigratorAction implements MigratorAction {
|
|||||||
this.path = path;
|
this.path = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void migrate(ConfigurationSection config) {
|
public void migrate(ConfigurationSection config) {
|
||||||
config.set(path, ACFUtil.parseLong(config.getString(path)));
|
config.set(path, ACFUtil.parseLong(config.getString(path)));
|
||||||
|
@ -3,6 +3,9 @@ package com.onarandombox.MultiverseCore.configuration.migration;
|
|||||||
import com.dumptruckman.minecraft.util.Logging;
|
import com.dumptruckman.minecraft.util.Logging;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Single migrator action changes a string value of "null" to an empty string.
|
||||||
|
*/
|
||||||
public class NullStringMigratorAction implements MigratorAction {
|
public class NullStringMigratorAction implements MigratorAction {
|
||||||
|
|
||||||
public static NullStringMigratorAction of(String path) {
|
public static NullStringMigratorAction of(String path) {
|
||||||
@ -15,6 +18,9 @@ public class NullStringMigratorAction implements MigratorAction {
|
|||||||
this.path = path;
|
this.path = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void migrate(ConfigurationSection config) {
|
public void migrate(ConfigurationSection config) {
|
||||||
config.set(path, "null".equals(config.getString(path)) ? "" : config.getString(path));
|
config.set(path, "null".equals(config.getString(path)) ? "" : config.getString(path));
|
||||||
|
Loading…
Reference in New Issue
Block a user