Class ConfigurationTransformation.VersionedBuilder
java.lang.Object
org.spongepowered.configurate.transformation.ConfigurationTransformation.VersionedBuilder
- Enclosing interface:
- ConfigurationTransformation
Builds a versioned
ConfigurationTransformation
.- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionaddVersion
(int version, @NonNull ConfigurationTransformation transformation) Adds a transformation to this builder for the given version.addVersion
(int version, @NonNull ConfigurationTransformation... transformations) Adds a new series of transformations for a version.build()
Builds the transformation.makeVersion
(int version, @NonNull Consumer<? super ConfigurationTransformation.Builder> maker) Create and add a new transformation to this builder.versionKey
(Object... versionKey) Sets the path of the version key within the configuration.
-
Method Details
-
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
Builds the transformation.- Returns:
- the transformation
- Since:
- 4.0.0
-