Class ConfigurateOps

java.lang.Object
org.spongepowered.configurate.extra.dfu.v4.ConfigurateOps
All Implemented Interfaces:
DynamicOps<ConfigurationNode>

public final class ConfigurateOps extends Object implements DynamicOps<ConfigurationNode>
Implementation of DataFixerUpper's DynamicOps.

The DynamicOps interface should be thought of essentially as a way to perform operations on a type without having to directly implement that interface on the type. Rather than taking an object that implements an interface, DFU methods take the implementation of the DynamicOps interface plus the type implemented onto.

When possible, the first node's ConfigurationNode.copy() method will be used to create a new node to contain results. Otherwise, the provided factory will be used. The default factory creates a CommentedConfigurationNode with the default serializer collection but a custom factory may be provided.

DynamicOps has the following primitive types (as determined by those codecs that implement PrimitiveCodec):

boolean
literal boolean, or numeric 1 for true, 0 for false
byte
numeric value, coerced to a byte. If compressMaps(), a string may be parsed as a byte as well.
short
numeric value, coerced to a short. If compressMaps(), a string may be parsed as a short as well.
int
numeric value, coerced to an integer. If compressMaps(), a string may be parsed as an integer as well.
long
numeric value, coerced to a long. If compressMaps(), a string may be parsed as a long as well.
float
numeric value, coerced to a float. If compressMaps(), a string may be parsed as a float as well.
double
numeric value, coerced to a double. If compressMaps(), a string may be parsed as a double as well.
String
Any scalar value, as a string
ByteBuffer
An array of bytes. Either a native byte array in the node, or (by default impl) a list of bytes
IntStream
A sequence of integers. Either a native int array in the node, or (by default impl) a list of integers
LongStream
A sequence of longs. Either a native long array in the node, or (by default impl) a list of longs
Since:
4.0.0