Package org.spongepowered.api.data
Interface DataHolderBuilder<H extends DataHolder,B extends DataHolderBuilder<H,B>>
-
- All Superinterfaces:
AbstractBuilder<H>,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 interfaceDataHolderBuilder.Immutable<H extends DataHolder.Immutable<H>,B extends DataHolderBuilder.Immutable<H,B>>static interfaceDataHolderBuilder.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 Badd(java.lang.Iterable<? extends Value<?>> values)Adds all theValues to the builder.default <V> Badd(java.util.function.Supplier<? extends Key<? extends Value<V>>> key, V value)Adds the givenKeywith the given value.default Badd(DataManipulator manipulator)Adds all theValues from theDataManipulatorto the builder.<V> Badd(Key<? extends Value<V>> key, V value)Adds the givenKeywith the given value.default Badd(Value<?> value)Adds the givenValueto the builder.default BaddFrom(DataHolder dataHolder)Adds all theValues from theDataHolderto the builder.Bfrom(H holder)Breset()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(java.lang.Iterable<? extends Value<?>> values)
- Parameters:
values- The values to add- Returns:
- This builder, for chaining
-
add
default B add(DataManipulator manipulator)
Adds all theValues from theDataManipulatorto the builder. TheValues are copied when theDataHolderis created.- Parameters:
manipulator- The manipulator to add- Returns:
- This builder, for chaining
-
addFrom
default B addFrom(DataHolder dataHolder)
Adds all theValues from theDataHolderto the builder. TheValues are copied when theDataHolderis 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 givenKeywith 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(java.util.function.Supplier<? extends Key<? extends Value<V>>> key, V value)
Adds the givenKeywith 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 knownDataManipulators from the givenDataHolderof typeDataHolderBuilder. This is a defensive copy asDataManipulatoris mutable.- Specified by:
fromin interfaceCopyableBuilder<H extends DataHolder,B extends DataHolderBuilder<H,B>>- Parameters:
holder- TheDataHolderto copy from- Returns:
- This builder for chaining
-
reset
B reset()
Description copied from interface:BuilderResets 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:
resetin interfaceBuilder<H extends DataHolder,B extends DataHolderBuilder<H,B>>- Specified by:
resetin interfaceResettableBuilder<H extends DataHolder,B extends DataHolderBuilder<H,B>>- Returns:
- This builder, for chaining
-
-