diff --git a/core/src/main/java/org/spongepowered/configurate/AbstractConfigurationNode.java b/core/src/main/java/org/spongepowered/configurate/AbstractConfigurationNode.java index 4cc0d773a..807561c4c 100644 --- a/core/src/main/java/org/spongepowered/configurate/AbstractConfigurationNode.java +++ b/core/src/main/java/org/spongepowered/configurate/AbstractConfigurationNode.java @@ -117,7 +117,7 @@ protected AbstractConfigurationNode(final @Nullable A parent, final A copyOf) { */ static V storeDefault(final ConfigurationNode node, final V defValue) { requireNonNull(defValue, "defValue"); - if (node.getOptions().shouldCopyDefaults()) { + if (node.getOptions().getShouldCopyDefaults()) { node.setValue(defValue); } return defValue; @@ -125,7 +125,7 @@ static V storeDefault(final ConfigurationNode node, final V defValue) { static V storeDefault(final ConfigurationNode node, final Type type, final V defValue) throws ObjectMappingException { requireNonNull(defValue, "defValue"); - if (node.getOptions().shouldCopyDefaults()) { + if (node.getOptions().getShouldCopyDefaults()) { node.setValue(type, defValue); } return defValue; diff --git a/core/src/main/java/org/spongepowered/configurate/ConfigurationNode.java b/core/src/main/java/org/spongepowered/configurate/ConfigurationNode.java index 36173c468..cb106d944 100644 --- a/core/src/main/java/org/spongepowered/configurate/ConfigurationNode.java +++ b/core/src/main/java/org/spongepowered/configurate/ConfigurationNode.java @@ -634,7 +634,7 @@ default String getString(final String def) { if (value != null) { return value; } - if (getOptions().shouldCopyDefaults()) { + if (getOptions().getShouldCopyDefaults()) { setValue(def); } return def; @@ -662,7 +662,7 @@ default float getFloat(float def) { if (val != null) { return val; } - if (getOptions().shouldCopyDefaults() && def != NUMBER_DEF) { + if (getOptions().getShouldCopyDefaults() && def != NUMBER_DEF) { setValue(def); } return def; @@ -690,7 +690,7 @@ default double getDouble(double def) { if (val != null) { return val; } - if (getOptions().shouldCopyDefaults() && def != NUMBER_DEF) { + if (getOptions().getShouldCopyDefaults() && def != NUMBER_DEF) { setValue(def); } return def; @@ -718,7 +718,7 @@ default int getInt(int def) { if (val != null) { return val; } - if (getOptions().shouldCopyDefaults() && def != NUMBER_DEF) { + if (getOptions().getShouldCopyDefaults() && def != NUMBER_DEF) { setValue(def); } return def; @@ -746,7 +746,7 @@ default long getLong(long def) { if (val != null) { return val; } - if (getOptions().shouldCopyDefaults() && def != NUMBER_DEF) { + if (getOptions().getShouldCopyDefaults() && def != NUMBER_DEF) { setValue(def); } return def; @@ -774,7 +774,7 @@ default boolean getBoolean(boolean def) { if (val != null) { return val; } - if (getOptions().shouldCopyDefaults()) { + if (getOptions().getShouldCopyDefaults()) { setValue(def); } return def; diff --git a/core/src/main/java/org/spongepowered/configurate/ConfigurationOptions.java b/core/src/main/java/org/spongepowered/configurate/ConfigurationOptions.java index 2f95ceccc..8c7950b4e 100644 --- a/core/src/main/java/org/spongepowered/configurate/ConfigurationOptions.java +++ b/core/src/main/java/org/spongepowered/configurate/ConfigurationOptions.java @@ -88,7 +88,7 @@ public ConfigurationOptions withMapFactory(final MapFactory mapFactory) { return this; } return new AutoValue_ConfigurationOptions(mapFactory, getHeader(), getSerializers(), getNativeTypes(), - shouldCopyDefaults(), isImplicitInitialization()); + getShouldCopyDefaults(), isImplicitInitialization()); } /** @@ -110,7 +110,7 @@ public ConfigurationOptions withHeader(final @Nullable String header) { return this; } return new AutoValue_ConfigurationOptions(getMapFactory(), header, getSerializers(), getNativeTypes(), - shouldCopyDefaults(), isImplicitInitialization()); + getShouldCopyDefaults(), isImplicitInitialization()); } /** @@ -133,7 +133,7 @@ public ConfigurationOptions withSerializers(final TypeSerializerCollection seria return this; } return new AutoValue_ConfigurationOptions(getMapFactory(), getHeader(), serializers, getNativeTypes(), - shouldCopyDefaults(), isImplicitInitialization()); + getShouldCopyDefaults(), isImplicitInitialization()); } /** @@ -211,7 +211,7 @@ public ConfigurationOptions withNativeTypes(final @Nullable Set> native return this; } return new AutoValue_ConfigurationOptions(getMapFactory(), getHeader(), getSerializers(), - nativeTypes == null ? null : UnmodifiableCollections.copyOf(nativeTypes), shouldCopyDefaults(), isImplicitInitialization()); + nativeTypes == null ? null : UnmodifiableCollections.copyOf(nativeTypes), getShouldCopyDefaults(), isImplicitInitialization()); } /** @@ -220,19 +220,19 @@ public ConfigurationOptions withNativeTypes(final @Nullable Set> native * * @return Whether defaults should be copied into value */ - public abstract boolean shouldCopyDefaults(); + public abstract boolean getShouldCopyDefaults(); /** * Creates a new {@link ConfigurationOptions} instance, with the specified * 'copy defaults' setting set, and all other settings copied from * this instance. * - * @see #shouldCopyDefaults() for information on what this method does + * @see #getShouldCopyDefaults() for information on what this method does * @param shouldCopyDefaults whether to copy defaults * @return updated options object */ public ConfigurationOptions withShouldCopyDefaults(final boolean shouldCopyDefaults) { - if (this.shouldCopyDefaults() == shouldCopyDefaults) { + if (this.getShouldCopyDefaults() == shouldCopyDefaults) { return this; } @@ -267,7 +267,7 @@ public ConfigurationOptions withImplicitInitialization(final boolean implicitIni } return new AutoValue_ConfigurationOptions(getMapFactory(), getHeader(), getSerializers(), getNativeTypes(), - shouldCopyDefaults(), implicitInitialization); + getShouldCopyDefaults(), implicitInitialization); } } diff --git a/core/src/main/java/org/spongepowered/configurate/objectmapping/ObjectMapperImpl.java b/core/src/main/java/org/spongepowered/configurate/objectmapping/ObjectMapperImpl.java index efda1b682..fb444b5b4 100644 --- a/core/src/main/java/org/spongepowered/configurate/objectmapping/ObjectMapperImpl.java +++ b/core/src/main/java/org/spongepowered/configurate/objectmapping/ObjectMapperImpl.java @@ -76,7 +76,7 @@ final V load0(final ConfigurationNode source, final CheckedFunction(); } diff --git a/core/src/main/java/org/spongepowered/configurate/reference/ValueReferenceImpl.java b/core/src/main/java/org/spongepowered/configurate/reference/ValueReferenceImpl.java index 1619a8762..7761881fc 100644 --- a/core/src/main/java/org/spongepowered/configurate/reference/ValueReferenceImpl.java +++ b/core/src/main/java/org/spongepowered/configurate/reference/ValueReferenceImpl.java @@ -72,7 +72,7 @@ class ValueReferenceImpl<@Nullable T, N extends ScopedConfigurationNode> impl final @Nullable T possible = this.serializer.deserialize(this.type.getType(), node); if (possible != null) { return possible; - } else if (defaultVal != null && node.getOptions().shouldCopyDefaults()) { + } else if (defaultVal != null && node.getOptions().getShouldCopyDefaults()) { this.serializer.serialize(this.type.getType(), defaultVal, node); } return defaultVal;