Class ConfigurateOpsBuilder
- java.lang.Object
-
- org.spongepowered.configurate.extra.dfu.v4.ConfigurateOpsBuilder
-
public final class ConfigurateOpsBuilder extends Object
A builder forConfigurateOps
instances.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigurateOps
build()
Create a new ops instance.Dynamic<ConfigurationNode>
buildWrapping(ConfigurationNode node)
Build a new ops instance, returned as part of a Dynamic.ConfigurateOpsBuilder
compressed(boolean compressed)
Set whetherKeyable
values should be compressed.ConfigurateOpsBuilder
factory(ConfigurationNodeFactory<? extends ConfigurationNode> supplier)
Set the node factory for the returned ops.ConfigurateOpsBuilder
factoryFromNode(ConfigurationNode node)
Set the node factory based on the options of the provided node.ConfigurateOpsBuilder
factoryFromSerializers(TypeSerializerCollection collection)
Set a node factory that will use the provided collection.ConfigurateOpsBuilder
readProtection(ConfigurateOps.Protection readProtection)
Set how nodes returned from read methods will be protected from modification.ConfigurateOpsBuilder
readWriteProtection(ConfigurateOps.Protection protection)
Set how nodes will be protected from both read and write modifications.ConfigurateOpsBuilder
writeProtection(ConfigurateOps.Protection writeProtection)
Set how nodes provided to mutator methods will be protected from modification.
-
-
-
Method Detail
-
factory
public ConfigurateOpsBuilder factory(ConfigurationNodeFactory<? extends ConfigurationNode> supplier)
Set the node factory for the returned ops.The default node factory wil create
CommentedConfigurationNode
instances using Confabricate's minecraft serializers.- Parameters:
supplier
- source for new nodes created to store values in thecreate*
methods- Returns:
- this builder
- Since:
- 4.0.0
-
factoryFromSerializers
public ConfigurateOpsBuilder factoryFromSerializers(TypeSerializerCollection collection)
Set a node factory that will use the provided collection.This will replace any set
factory(ConfigurationNodeFactory)
.- Parameters:
collection
- type serializers to use for nodes.- Returns:
- this builder
- Since:
- 4.0.0
-
factoryFromNode
public ConfigurateOpsBuilder factoryFromNode(ConfigurationNode node)
Set the node factory based on the options of the provided node.This will replace any set
factory(ConfigurationNodeFactory)
.- Parameters:
node
- node to use- Returns:
- this builder
- Since:
- 4.0.0
-
compressed
public ConfigurateOpsBuilder compressed(boolean compressed)
Set whetherKeyable
values should be compressed.- Parameters:
compressed
- whether to compress values- Returns:
- this builder
- Since:
- 4.0.0
- See Also:
for more about what compression is
-
readProtection
public ConfigurateOpsBuilder readProtection(ConfigurateOps.Protection readProtection)
Set how nodes returned from read methods will be protected from modification.For read protection, the protection level refers to how the attached node will be affected by modifications made to the nodes returned from
get*
methods.- Parameters:
readProtection
- protection level- Returns:
- this builder
- Since:
- 4.0.0
-
writeProtection
public ConfigurateOpsBuilder writeProtection(ConfigurateOps.Protection writeProtection)
Set how nodes provided to mutator methods will be protected from modification.For write protection, the protection level refers to how the provided
prefix
node will be protected from seeing changes to the operation- Parameters:
writeProtection
- protection level- Returns:
- this builder
- Since:
- 4.0.0
-
readWriteProtection
public ConfigurateOpsBuilder readWriteProtection(ConfigurateOps.Protection protection)
Set how nodes will be protected from both read and write modifications.- Parameters:
protection
- protection level- Returns:
- this builder
- Since:
- 4.0.0
- See Also:
for how this level affects value reads
,for how this level affects value writes
-
build
public ConfigurateOps build()
Create a new ops instance.All options have defaults provided and all setters validate their input, so by the time this method is reached the builder will be in a valid state.
- Returns:
- the new instance
- Since:
- 4.0.0
-
buildWrapping
public Dynamic<ConfigurationNode> buildWrapping(ConfigurationNode node)
Build a new ops instance, returned as part of a Dynamic.Returned ops instances will not take type serializers or other options from the provided node. For that, use
factoryFromNode(ConfigurationNode)
.- Parameters:
node
- wrapped node- Returns:
- new dynamic
- Since:
- 4.0.0
-
-