Package org.spongepowered.api.data
Interface DataHolderBuilder<H extends DataHolder,B extends DataHolderBuilder<H,B>>
- All Superinterfaces:
AbstractBuilder<H>
,Builder<H,
,B> CopyableBuilder<H,
,B> ResettableBuilder<H,
B>
- All Known Subinterfaces:
BlockEntityArchetype.Builder
,BlockSnapshot.Builder
,BlockState.Builder
,DataHolderBuilder.Immutable<H,
,B> DataHolderBuilder.Mutable<H,
,B> EntityArchetype.Builder
,EntitySnapshot.Builder
,FluidStack.Builder
,FluidStackSnapshot.Builder
,FluidState.Builder
,ItemStack.Builder
,SerializableDataHolderBuilder<H,
,B> SerializableDataHolderBuilder.Immutable<H,
,B> SerializableDataHolderBuilder.Mutable<H,
,B> State.Builder<S,
B>
public interface DataHolderBuilder<H extends DataHolder,B extends DataHolderBuilder<H,B>>
extends Builder<H,B>, CopyableBuilder<H,B>
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
DataHolderBuilder.Immutable<H extends DataHolder.Immutable<H>,
B extends DataHolderBuilder.Immutable<H, B>> static interface
DataHolderBuilder.Mutable<H extends DataHolder.Mutable,
B extends DataHolderBuilder.Mutable<H, B>> -
Method Summary
Modifier and TypeMethodDescriptiondefault B
Adds all theValue
s to the builder.default <V> B
Adds the givenKey
with the given value.default B
add
(DataManipulator manipulator) Adds all theValue
s from theDataManipulator
to the builder.<V> B
Adds the givenKey
with the given value.default B
Adds the givenValue
to the builder.default B
addFrom
(DataHolder dataHolder) Adds all theValue
s from theDataHolder
to the builder.reset()
Resets this builder to a "default" state such that there is no remaining data to set.Methods inherited from interface net.kyori.adventure.builder.AbstractBuilder
build
-
Method Details
-
add
- Parameters:
value
- The value to add- Returns:
- This builder, for chaining
-
add
- Parameters:
values
- The values to add- Returns:
- This builder, for chaining
-
add
Adds all theValue
s from theDataManipulator
to the builder. TheValue
s are copied when theDataHolder
is created.- Parameters:
manipulator
- The manipulator to add- Returns:
- This builder, for chaining
-
addFrom
Adds all theValue
s from theDataHolder
to the builder. TheValue
s are copied when theDataHolder
is created.- Parameters:
dataHolder
- The data holder to add data from- Returns:
- This builder, for chaining
-
add
Adds the givenKey
with the given value.- Type Parameters:
V
- The type of the value- Parameters:
key
- The key to assign the value withvalue
- The value to assign with the key- Returns:
- This builder, for chaining
-
add
Adds the givenKey
with the given value.- Type Parameters:
V
- The type of the value- Parameters:
key
- The key to assign the value withvalue
- The value to assign with the key- Returns:
- This builder, for chaining
-
from
Copies all knownDataManipulator
s from the givenDataHolder
of typeDataHolderBuilder
. This is a defensive copy asDataManipulator
is mutable.- Specified by:
from
in interfaceCopyableBuilder<H extends DataHolder,
B extends DataHolderBuilder<H, B>> - Parameters:
holder
- TheDataHolder
to copy from- Returns:
- This builder for chaining
-
reset
B reset()Description copied from interface:Builder
Resets this builder to a "default" state such that there is no remaining data to set. This is to be the presumed "default" state.- Specified by:
reset
in interfaceBuilder<H extends DataHolder,
B extends DataHolderBuilder<H, B>> - Specified by:
reset
in interfaceResettableBuilder<H extends DataHolder,
B extends DataHolderBuilder<H, B>> - Returns:
- This builder, for chaining
-