Class DataFixerTransformation
java.lang.Object
org.spongepowered.configurate.extra.dfu.v3.DataFixerTransformation
- All Implemented Interfaces:
ConfigurationTransformation,ConfigurationTransformation.Versioned
public final class DataFixerTransformation
extends Object
implements ConfigurationTransformation.Versioned
A transformation that exposes a single DataFixer to a configuration in a
friendly way.
Because Configurate does not have a schema model and DFU does, this transformation works by explicitly providing a mapping between configurate node paths and DFU TypeReferences.
- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.spongepowered.configurate.transformation.ConfigurationTransformation
ConfigurationTransformation.Versioned, ConfigurationTransformation.VersionedBuilder -
Field Summary
Fields inherited from interface org.spongepowered.configurate.transformation.ConfigurationTransformation
WILDCARD_OBJECTFields inherited from interface org.spongepowered.configurate.transformation.ConfigurationTransformation.Versioned
VERSION_UNKNOWN -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(@NonNull ConfigurationNode node) Apply this transformation to a given node.Create a builder that can work with any DFU DataFixer.intGet the latest version that nodes can be updated to.intversion(ConfigurationNode root) Get the version from a specific configuration node, using the configured version key.Get the path the node's current version is located at.
-
Method Details
-
dfuBuilder
Create a builder that can work with any DFU DataFixer.- Returns:
- the builder
- Since:
- 4.0.0
-
apply
Description copied from interface:ConfigurationTransformationApply this transformation to a given node.- Specified by:
applyin interfaceConfigurationTransformation- Parameters:
node- the target node- Throws:
ConfigurateException
-
version
Get the version from a specific configuration node, using the configured version key.- Specified by:
versionin interfaceConfigurationTransformation.Versioned- Parameters:
root- base node to query- Returns:
- version, or -1 if this node is unversioned.
-
versionKey
Description copied from interface:ConfigurationTransformation.VersionedGet the path the node's current version is located at.- Specified by:
versionKeyin interfaceConfigurationTransformation.Versioned- Returns:
- version path
-
latestVersion
Description copied from interface:ConfigurationTransformation.VersionedGet the latest version that nodes can be updated to.- Specified by:
latestVersionin interfaceConfigurationTransformation.Versioned- Returns:
- the most recent version
-