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
Nested ClassesModifier and TypeInterfaceDescriptionstatic 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
Modifier and TypeMethodDescriptiondefault BAdds all theValues to the builder.default <V> BAdds the givenKeywith the given value.default Badd(DataManipulator manipulator) Adds all theValues from theDataManipulatorto the builder.<V> BAdds the givenKeywith the given value.default BAdds the givenValueto the builder.default BaddFrom(DataHolder dataHolder) Adds all theValues from theDataHolderto 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 theValues from theDataManipulatorto the builder. TheValues are copied when theDataHolderis created.- Parameters:
manipulator- The manipulator to add- Returns:
- This builder, for chaining
-
addFrom
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
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
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
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
-