Class ConfigurationTransformation.VersionedBuilder
- java.lang.Object
-
- org.spongepowered.configurate.transformation.ConfigurationTransformation.VersionedBuilder
-
- Enclosing interface:
- ConfigurationTransformation
public static final class ConfigurationTransformation.VersionedBuilder extends Object
Builds a versionedConfigurationTransformation
.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull ConfigurationTransformation.VersionedBuilder
addVersion(int version, @NonNull ConfigurationTransformation transformation)
Adds a transformation to this builder for the given version.@NonNull ConfigurationTransformation.VersionedBuilder
addVersion(int version, @NonNull ConfigurationTransformation... transformations)
Adds a new series of transformations for a version.@NonNull ConfigurationTransformation.Versioned
build()
Builds the transformation.@NonNull ConfigurationTransformation.VersionedBuilder
makeVersion(int version, @NonNull Consumer<? super ConfigurationTransformation.Builder> maker)
Create and add a new transformation to this builder.ConfigurationTransformation.VersionedBuilder
versionKey(Object... versionKey)
Sets the path of the version key within the configuration.
-
-
-
Method Detail
-
versionKey
public ConfigurationTransformation.VersionedBuilder versionKey(Object... versionKey)
Sets the path of the version key within the configuration.- Parameters:
versionKey
- the path to the version key- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
-
addVersion
public @NonNull ConfigurationTransformation.VersionedBuilder addVersion(int version, @NonNull ConfigurationTransformation transformation)
Adds a transformation to this builder for the given version.The version must be between 0 and
Integer.MAX_VALUE
, and a version cannot be specified multiple times.- Parameters:
version
- the versiontransformation
- the transformation- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
-
addVersion
public @NonNull ConfigurationTransformation.VersionedBuilder addVersion(int version, @NonNull ConfigurationTransformation... transformations)
Adds a new series of transformations for a version.The version must be between 0 and
Integer.MAX_VALUE
.- Parameters:
version
- the versiontransformations
- the transformations. To perform a version upgrade, these transformations will be executed in order.- Returns:
- this builder
- Since:
- 4.0.0
-
makeVersion
public @NonNull ConfigurationTransformation.VersionedBuilder makeVersion(int version, @NonNull Consumer<? super ConfigurationTransformation.Builder> maker)
Create and add a new transformation to this builder.The transformation will be created from the builder passed to the callback function
The version must be between 0 and
Integer.MAX_VALUE
- Parameters:
version
- the versionmaker
- the transformation- Returns:
- this builder
- Since:
- 4.0.0
-
build
public @NonNull ConfigurationTransformation.Versioned build()
Builds the transformation.- Returns:
- the transformation
- Since:
- 4.0.0
-
-