Package org.spongepowered.api.data
Interface DataHolderBuilder<H extends DataHolder,B extends DataHolderBuilder<H,B>>
-
- All Superinterfaces:
Buildable.Builder<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
Nested Classes Modifier and Type Interface Description static 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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default B
add(Iterable<? extends Value<?>> values)
Adds all theValue
s to the builder.default <V> B
add(Supplier<? extends Key<? extends Value<V>>> key, V value)
Adds the givenKey
with the given value.default B
add(DataManipulator manipulator)
Adds all theValue
s from theDataManipulator
to the builder.<V> B
add(Key<? extends Value<V>> key, V value)
Adds the givenKey
with the given value.default B
add(Value<?> value)
Adds the givenValue
to the builder.default B
addFrom(DataHolder dataHolder)
Adds all theValue
s from theDataHolder
to the builder.B
from(H holder)
B
reset()
Resets this builder to a "default" state such that there is no remaining data to set.-
Methods inherited from interface net.kyori.adventure.util.Buildable.Builder
build
-
-
-
-
Method Detail
-
add
default B add(Value<?> value)
- Parameters:
value
- The value to add- Returns:
- This builder, for chaining
-
add
default B add(Iterable<? extends Value<?>> values)
- Parameters:
values
- The values to add- Returns:
- This builder, for chaining
-
add
default B add(DataManipulator manipulator)
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
default B addFrom(DataHolder dataHolder)
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
<V> B add(Key<? extends Value<V>> key, V value)
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
default <V> B add(Supplier<? extends Key<? extends Value<V>>> key, V value)
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
B from(H holder)
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
-
-