H
- The type of ImmutableDataHolder
E
- The extended ImmutableDataBuilder
public interface ImmutableDataBuilder<H extends ImmutableDataHolder<H>,E extends ImmutableDataBuilder<H,E>> extends DataBuilder<H>
DataBuilder
except that it builds
ImmutableDataHolder
s. While the ImmutableDataHolder
is like
a DataHolder
, it is immutable.Modifier and Type | Method and Description |
---|---|
E |
add(DataManipulator<?,?> manipulator)
Adds the given
DataManipulator to the builder. |
E |
add(ImmutableDataManipulator<?,?> manipulator)
Adds the given
ImmutableDataManipulator to the builder. |
<V> E |
add(Key<? extends BaseValue<V>> key,
V value)
Adds the given
Key with the given value. |
H |
build()
Attempts to build a new
ImmutableDataHolder . |
E |
from(H holder)
Copies all known
DataManipulator s from the given
ImmutableDataHolder . |
E |
reset()
Resets this builder to a "default" state such that there is no
remaining data to set.
|
build
E add(DataManipulator<?,?> manipulator)
DataManipulator
to the builder. The
DataManipulator
is copied when the ImmutableDataHolder
is created.manipulator
- The manipulator to addE add(ImmutableDataManipulator<?,?> manipulator)
ImmutableDataManipulator
to the builder.manipulator
- The manipulator to add<V> E add(Key<? extends BaseValue<V>> key, V value)
Key
with the given value.V
- The type of the valuekey
- The key to assign the value withvalue
- The value to assign with the keyE from(H holder)
DataManipulator
s from the given
ImmutableDataHolder
. This is a defensive copy as
DataManipulator
is mutable.from
in interface DataBuilder<H extends ImmutableDataHolder<H>>
from
in interface ResettableBuilder<H extends ImmutableDataHolder<H>,DataBuilder<H extends ImmutableDataHolder<H>>>
holder
- The ImmutableDataHolder
to copy fromH build()
ImmutableDataHolder
.E reset()
ResettableBuilder
reset
in interface DataBuilder<H extends ImmutableDataHolder<H>>
reset
in interface ResettableBuilder<H extends ImmutableDataHolder<H>,DataBuilder<H extends ImmutableDataHolder<H>>>