Interface ConfigurationTransformation.Versioned
-
- All Superinterfaces:
ConfigurationTransformation
- All Known Implementing Classes:
DataFixerTransformation
,DataFixerTransformation
- Enclosing interface:
- ConfigurationTransformation
public static interface ConfigurationTransformation.Versioned extends ConfigurationTransformation
A transformation that is aware of node versions.- Since:
- 4.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.configurate.transformation.ConfigurationTransformation
ConfigurationTransformation.Builder, ConfigurationTransformation.Versioned, ConfigurationTransformation.VersionedBuilder
-
-
Field Summary
Fields Modifier and Type Field Description static int
VERSION_UNKNOWN
-
Fields inherited from interface org.spongepowered.configurate.transformation.ConfigurationTransformation
WILDCARD_OBJECT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
latestVersion()
Get the latest version that nodes can be updated to.default int
version(ConfigurationNode node)
Get the version of a node hierarchy.NodePath
versionKey()
Get the path the node's current version is located at.-
Methods inherited from interface org.spongepowered.configurate.transformation.ConfigurationTransformation
apply
-
-
-
-
Field Detail
-
VERSION_UNKNOWN
static final int VERSION_UNKNOWN
- See Also:
- Constant Field Values
-
-
Method Detail
-
versionKey
NodePath versionKey()
Get the path the node's current version is located at.- Returns:
- version path
- Since:
- 4.0.0
-
latestVersion
int latestVersion()
Get the latest version that nodes can be updated to.- Returns:
- the most recent version
- Since:
- 4.0.0
-
version
default int version(ConfigurationNode node)
Get the version of a node hierarchy.Note that the node checked here must be the same node passed to
ConfigurationTransformation.apply(ConfigurationNode)
, not any node in a hierarchy.If the node value is not present or not coercible to an integer,
VERSION_UNKNOWN
will be returned. When the transformation is executed, every version transformation will be applied.- Parameters:
node
- node to check- Returns:
- version, or
VERSION_UNKNOWN
if no value is present - Since:
- 4.0.0
-
-