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 Classes Modifier and Type Class Description static classDataFixerTransformation.BuilderBuilder forDataFixerTransformation.- 
Nested 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_OBJECT 
- 
Fields inherited from interface org.spongepowered.configurate.transformation.ConfigurationTransformation.Versioned
VERSION_UNKNOWN 
 - 
 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(@NonNull ConfigurationNode node)Apply this transformation to a given node.static DataFixerTransformation.BuilderdfuBuilder()Create a builder that can work with any DFU DataFixer.intlatestVersion()Get 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.NodePathversionKey()Get the path the node's current version is located at. 
 - 
 
- 
- 
Method Detail
- 
dfuBuilder
public static DataFixerTransformation.Builder dfuBuilder()
Create a builder that can work with any DFU DataFixer.- Returns:
 - the builder
 - Since:
 - 4.0.0
 
 
- 
apply
public void apply(@NonNull ConfigurationNode node) throws ConfigurateException
Description copied from interface:ConfigurationTransformationApply this transformation to a given node.- Specified by:
 applyin interfaceConfigurationTransformation- Parameters:
 node- the target node- Throws:
 ConfigurateException
 
- 
version
public int version(ConfigurationNode root)
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
public NodePath 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
public int 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
 
 
 - 
 
 -