T
- The type of DataManipulator
public interface DataManipulatorBuilder<T extends DataManipulator<T,I>,I extends ImmutableDataManipulator<I,T>> extends DataBuilder<T>
DataManipulator
s. This builder can build
a specific DataManipulator
that can be used to pre-construct
customized data prior to applying to a DataHolder
.
DataManipulatorBuilder
s must be registered with the
DataManager
before they can be used by the game
and plugins. Failure to do so may prevent the DataManipulator
from
being used.
Modifier and Type | Method and Description |
---|---|
T |
create()
Creates a new specific
DataManipulator for consumption. |
Optional<T> |
createFrom(DataHolder dataHolder)
Attempts to read data from the given
DataHolder and constructs
a new copy of the DataManipulator as an instance of
T . |
build, from, reset
T create()
DataManipulator
for consumption.Optional<T> createFrom(DataHolder dataHolder)
DataHolder
and constructs
a new copy of the DataManipulator
as an instance of
T
.
If the DataHolder
does not contain the necessary information
to pre-populate the DataManipulator
, a fresh new
DataManipulator
is returned. If the DataManipulator
is
incompatible with the DataHolder
, Optional.empty()
is
returned.
dataHolder
- The DataHolder
to extract dataDataManipulator
with relevant data
filled from the given DataHolder
, if available