diff --git a/common/serializer/src/main/java/it/angrybear/yagl/parsers/TypedParser.java b/common/serializer/src/main/java/it/angrybear/yagl/parsers/TypedParser.java index b8849039..68b15cfb 100644 --- a/common/serializer/src/main/java/it/angrybear/yagl/parsers/TypedParser.java +++ b/common/serializer/src/main/java/it/angrybear/yagl/parsers/TypedParser.java @@ -6,7 +6,6 @@ import it.fulminazzo.yamlparser.configuration.IConfiguration; import it.fulminazzo.yamlparser.parsers.CallableYAMLParser; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * This parser allows parsing an object using the {@link CallableYAMLParser} methods. @@ -34,7 +33,7 @@ public TypedParser(final @NotNull Class clazz) { @SuppressWarnings("unchecked") @Override - protected @NotNull TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable C> getDumper() { + protected TriConsumer getDumper() { return (c, s, g) -> { super.getDumper().accept(c, s, g); if (g == null) return; diff --git a/gui/serializer/src/main/java/it/angrybear/yagl/parsers/GUIParser.java b/gui/serializer/src/main/java/it/angrybear/yagl/parsers/GUIParser.java index 9d6bc8c1..86bd29ea 100644 --- a/gui/serializer/src/main/java/it/angrybear/yagl/parsers/GUIParser.java +++ b/gui/serializer/src/main/java/it/angrybear/yagl/parsers/GUIParser.java @@ -6,7 +6,6 @@ import it.fulminazzo.fulmicollection.objects.Refl; import it.fulminazzo.fulmicollection.utils.ReflectionUtils; import it.fulminazzo.yamlparser.configuration.IConfiguration; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.List; @@ -24,7 +23,7 @@ public GUIParser() { } @Override - protected @NotNull BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable GUI> getLoader() { + protected BiFunctionException getLoader() { return (c, s) -> { GUI g = super.getLoader().apply(c, s); Integer size = c.getInteger(s + ".size"); @@ -40,7 +39,7 @@ public GUIParser() { } @Override - protected @NotNull TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable GUI> getDumper() { + protected TriConsumer getDumper() { return (c, s, g) -> { super.getDumper().accept(c, s, g); if (g == null) return; diff --git a/gui/serializer/src/main/java/it/angrybear/yagl/parsers/SerializableFunctionParser.java b/gui/serializer/src/main/java/it/angrybear/yagl/parsers/SerializableFunctionParser.java index 711977ac..3e25f37e 100644 --- a/gui/serializer/src/main/java/it/angrybear/yagl/parsers/SerializableFunctionParser.java +++ b/gui/serializer/src/main/java/it/angrybear/yagl/parsers/SerializableFunctionParser.java @@ -9,7 +9,6 @@ import it.fulminazzo.yamlparser.configuration.IConfiguration; import it.fulminazzo.yamlparser.parsers.YAMLParser; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.lang.reflect.Constructor; @@ -26,12 +25,12 @@ public class SerializableFunctionParser extends * * @param clazz the {@link SerializableFunction} class */ - public SerializableFunctionParser(@NotNull Class clazz) { + public SerializableFunctionParser(final @NotNull Class clazz) { super(clazz); } @Override - protected @NotNull BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable F> getLoader() { + protected BiFunctionException getLoader() { return (c, s) -> { ConfigurationSection section = c.getConfigurationSection(s); if (section == null) return null; @@ -52,7 +51,7 @@ public SerializableFunctionParser(@NotNull Class clazz) { } @Override - protected @NotNull TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable F> getDumper() { + protected TriConsumer getDumper() { return (c, s, f) -> { c.set(s, null); if (f == null) return; diff --git a/item/serializer/src/main/java/it/angrybear/yagl/parsers/ItemParser.java b/item/serializer/src/main/java/it/angrybear/yagl/parsers/ItemParser.java index d0614c6a..35dee3bf 100644 --- a/item/serializer/src/main/java/it/angrybear/yagl/parsers/ItemParser.java +++ b/item/serializer/src/main/java/it/angrybear/yagl/parsers/ItemParser.java @@ -11,8 +11,6 @@ import it.fulminazzo.yamlparser.configuration.ConfigurationSection; import it.fulminazzo.yamlparser.configuration.IConfiguration; import it.fulminazzo.yamlparser.parsers.YAMLParser; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; @@ -31,7 +29,7 @@ public ItemParser() { } @Override - protected @NotNull BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable Item> getLoader() { + protected BiFunctionException getLoader() { return (c, s) -> { final ConfigurationSection itemSection = c.getConfigurationSection(s); if (itemSection == null) return null; @@ -63,7 +61,7 @@ public ItemParser() { } @Override - protected @NotNull TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable Item> getDumper() { + protected TriConsumer getDumper() { return (c, s, i) -> { c.set(s, null); if (i != null) { diff --git a/item/serializer/src/main/java/it/angrybear/yagl/parsers/RecipeParser.java b/item/serializer/src/main/java/it/angrybear/yagl/parsers/RecipeParser.java index d0dcc568..11ba37d5 100644 --- a/item/serializer/src/main/java/it/angrybear/yagl/parsers/RecipeParser.java +++ b/item/serializer/src/main/java/it/angrybear/yagl/parsers/RecipeParser.java @@ -7,8 +7,6 @@ import it.fulminazzo.fulmicollection.interfaces.functions.TriConsumer; import it.fulminazzo.fulmicollection.objects.Refl; import it.fulminazzo.yamlparser.configuration.IConfiguration; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.LinkedList; import java.util.List; @@ -38,7 +36,7 @@ protected BiFunctionException getLoader() { } @Override - protected @NotNull TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable Recipe> getDumper() { + protected TriConsumer getDumper() { return super.getDumper().andThen((c, s, r) -> { if (r == null) return; if (!r.isEmpty()) c.set(s + ".ingredients.value-class", null); diff --git a/wrappers/serializer/src/main/java/it/angrybear/yagl/parsers/ColorParser.java b/wrappers/serializer/src/main/java/it/angrybear/yagl/parsers/ColorParser.java index 26bd6b51..f0fba524 100644 --- a/wrappers/serializer/src/main/java/it/angrybear/yagl/parsers/ColorParser.java +++ b/wrappers/serializer/src/main/java/it/angrybear/yagl/parsers/ColorParser.java @@ -5,8 +5,6 @@ import it.fulminazzo.fulmicollection.interfaces.functions.TriConsumer; import it.fulminazzo.yamlparser.configuration.IConfiguration; import it.fulminazzo.yamlparser.parsers.YAMLParser; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * A parser to serialize {@link Color}. @@ -21,7 +19,7 @@ public ColorParser() { } @Override - protected @NotNull BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable Color> getLoader() { + protected BiFunctionException getLoader() { return (c, s) -> { String name = c.getString(s); if (name == null) return null; @@ -32,7 +30,7 @@ public ColorParser() { } @Override - protected @NotNull TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable Color> getDumper() { + protected TriConsumer getDumper() { return (c, s, o) -> { c.set(s, null); if (o == null) return; diff --git a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/BlockDataOptionParser.java b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/BlockDataOptionParser.java index 630d0e24..cf458738 100644 --- a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/BlockDataOptionParser.java +++ b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/BlockDataOptionParser.java @@ -4,8 +4,6 @@ import it.fulminazzo.fulmicollection.interfaces.functions.TriConsumer; import it.fulminazzo.yamlparser.configuration.IConfiguration; import it.fulminazzo.yamlparser.parsers.YAMLParser; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * A parser to serialize {@link BlockDataOption}. @@ -21,7 +19,7 @@ public BlockDataOptionParser() { } @Override - protected BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable BlockDataOption> getLoader() { + protected BiFunctionException getLoader() { return (c, s) -> { String raw = c.getString(s); if (raw == null) return null; @@ -30,7 +28,7 @@ public BlockDataOptionParser() { } @Override - protected TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable BlockDataOption> getDumper() { + protected TriConsumer getDumper() { return (c, s, b) -> { c.set(s, null); if (b == null) return; diff --git a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ColorOptionParser.java b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ColorOptionParser.java index 9c5b7033..b6ddc968 100644 --- a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ColorOptionParser.java +++ b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ColorOptionParser.java @@ -5,8 +5,6 @@ import it.fulminazzo.fulmicollection.interfaces.functions.TriConsumer; import it.fulminazzo.yamlparser.configuration.IConfiguration; import it.fulminazzo.yamlparser.parsers.YAMLParser; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * A parser to serialize {@link ColorParticleOption}. @@ -22,7 +20,7 @@ public ColorOptionParser() { } @Override - protected BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable ColorParticleOption> getLoader() { + protected BiFunctionException getLoader() { return (c, s) -> { Color color = c.get(s, Color.class); if (color == null) return null; @@ -31,7 +29,7 @@ public ColorOptionParser() { } @Override - protected TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable ColorParticleOption> getDumper() { + protected TriConsumer getDumper() { return (c, s, p) -> c.set(s, p == null ? null : p.getOption()); } } diff --git a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ItemParticleOptionParser.java b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ItemParticleOptionParser.java index 5f93feb7..d4214ee6 100644 --- a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ItemParticleOptionParser.java +++ b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ItemParticleOptionParser.java @@ -6,8 +6,6 @@ import it.fulminazzo.fulmicollection.utils.ReflectionUtils; import it.fulminazzo.yamlparser.configuration.IConfiguration; import it.fulminazzo.yamlparser.parsers.YAMLParser; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * A parser to serialize {@link ItemParticleOption}. @@ -22,7 +20,7 @@ public ItemParticleOptionParser() { } @Override - protected BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable ItemParticleOption> getLoader() { + protected BiFunctionException> getLoader() { return (c, s) -> { AbstractItem item = c.get(s, ReflectionUtils.getClass("it.angrybear.yagl.items.Item")); if (item == null) return null; @@ -31,7 +29,7 @@ public ItemParticleOptionParser() { } @Override - protected TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable ItemParticleOption> getDumper() { + protected TriConsumer> getDumper() { return (c, s, o) -> c.set(s, o == null ? null : o.getOption()); } } diff --git a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/MaterialDataOptionParser.java b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/MaterialDataOptionParser.java index 3757bd38..27da299e 100644 --- a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/MaterialDataOptionParser.java +++ b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/MaterialDataOptionParser.java @@ -5,8 +5,6 @@ import it.fulminazzo.fulmicollection.structures.Tuple; import it.fulminazzo.yamlparser.configuration.IConfiguration; import it.fulminazzo.yamlparser.parsers.YAMLParser; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * A parser to serialize {@link MaterialDataOption}. @@ -22,7 +20,7 @@ public MaterialDataOptionParser() { } @Override - protected BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable MaterialDataOption> getLoader() { + protected BiFunctionException getLoader() { return (c, s) -> { String raw = c.getString(s); if (raw == null) return null; @@ -31,7 +29,7 @@ public MaterialDataOptionParser() { } @Override - protected TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable MaterialDataOption> getDumper() { + protected TriConsumer getDumper() { return (c, s, b) -> { c.set(s, null); if (b == null) return; diff --git a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ParticleOptionParser.java b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ParticleOptionParser.java index 45a47f24..73093dc7 100644 --- a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ParticleOptionParser.java +++ b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ParticleOptionParser.java @@ -10,7 +10,6 @@ import it.fulminazzo.yamlparser.parsers.YAMLParser; import it.fulminazzo.yamlparser.parsers.annotations.PreventSaving; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.lang.reflect.Field; import java.lang.reflect.Modifier; @@ -35,7 +34,7 @@ public ParticleOptionParser(@NotNull Class

pClass) { } @Override - protected @NotNull BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable P> getLoader() { + protected BiFunctionException getLoader() { return (c, s) -> { Refl reflP = new Refl<>(getOClass(), new Object[0]); @@ -62,7 +61,7 @@ private void loadField(@NotNull Refl reflP, @NotNull IConfiguration section, } @Override - protected @NotNull TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable P> getDumper() { + protected TriConsumer getDumper() { return (c, s, p) -> { c.set(s, null); if (p == null) return; diff --git a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ParticleParser.java b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ParticleParser.java index 071659cf..452452a6 100644 --- a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ParticleParser.java +++ b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/ParticleParser.java @@ -7,8 +7,6 @@ import it.fulminazzo.yamlparser.configuration.ConfigurationSection; import it.fulminazzo.yamlparser.configuration.IConfiguration; import it.fulminazzo.yamlparser.parsers.YAMLParser; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * A parser to serialize {@link Particle}. @@ -23,7 +21,7 @@ public ParticleParser() { } @Override - protected @NotNull BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable Particle> getLoader() { + protected BiFunctionException getLoader() { return (c, s) -> { ConfigurationSection particleSection = c.getConfigurationSection(s); if (particleSection == null) return null; @@ -48,7 +46,7 @@ public ParticleParser() { } @Override - protected @NotNull TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable Particle> getDumper() { + protected TriConsumer getDumper() { return (c, s, p) -> { c.set(s, null); if (p == null) return; diff --git a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/PotionParticleOptionParser.java b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/PotionParticleOptionParser.java index edbca125..a2a1c58c 100644 --- a/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/PotionParticleOptionParser.java +++ b/wrappers/serializer/src/main/java/it/angrybear/yagl/particles/PotionParticleOptionParser.java @@ -5,8 +5,6 @@ import it.fulminazzo.fulmicollection.interfaces.functions.TriConsumer; import it.fulminazzo.yamlparser.configuration.IConfiguration; import it.fulminazzo.yamlparser.parsers.YAMLParser; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * A parser to serialize {@link PotionParticleOption}. @@ -22,7 +20,7 @@ public PotionParticleOptionParser() { } @Override - protected BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable PotionParticleOption> getLoader() { + protected BiFunctionException getLoader() { return (c, s) -> { Potion potion = c.get(s, Potion.class); if (potion == null) return null; @@ -31,7 +29,7 @@ public PotionParticleOptionParser() { } @Override - protected TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable PotionParticleOption> getDumper() { + protected TriConsumer getDumper() { return (c, s, p) -> c.set(s, p == null ? null : p.getOption()); } } diff --git a/wrappers/serializer/src/main/java/it/angrybear/yagl/wrappers/WrapperParser.java b/wrappers/serializer/src/main/java/it/angrybear/yagl/wrappers/WrapperParser.java index 1b0974cc..f39c47d9 100644 --- a/wrappers/serializer/src/main/java/it/angrybear/yagl/wrappers/WrapperParser.java +++ b/wrappers/serializer/src/main/java/it/angrybear/yagl/wrappers/WrapperParser.java @@ -9,7 +9,6 @@ import it.fulminazzo.yamlparser.configuration.IConfiguration; import it.fulminazzo.yamlparser.parsers.YAMLParser; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.lang.reflect.Constructor; import java.lang.reflect.Field; @@ -35,7 +34,7 @@ public WrapperParser(@NotNull Class clazz) { } @Override - protected @NotNull BiFunctionException<@NotNull IConfiguration, @NotNull String, @Nullable W> getLoader() { + protected BiFunctionException getLoader() { return (c, s) -> { String raw = c.getString(s); if (raw == null || raw.trim().isEmpty()) return null; @@ -80,7 +79,7 @@ public WrapperParser(@NotNull Class clazz) { } @Override - protected @NotNull TriConsumer<@NotNull IConfiguration, @NotNull String, @Nullable W> getDumper() { + protected TriConsumer getDumper() { return (c, s, w) -> { c.set(s, null); if (w == null) return;