public interface DataHolder extends MutableDataSetter
| Modifier and Type | Field and Description |
|---|---|
static DataHolder |
NULL |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(@NotNull DataKeyBase<?> key) |
default <T> T |
get(@NotNull DataKey<T> key)
Deprecated.
|
@NotNull Map<? extends DataKeyBase<?>,Object> |
getAll() |
@NotNull Collection<? extends DataKeyBase<?>> |
getKeys() |
Object |
getOrCompute(@NotNull DataKeyBase<?> key,
@NotNull DataValueFactory<?> factory)
Get key if it exists or compute using supplier
|
default @NotNull MutableDataHolder |
setIn(@NotNull MutableDataHolder dataHolder) |
default @NotNull DataSet |
toDataSet() |
@NotNull DataHolder |
toImmutable() |
@NotNull MutableDataHolder |
toMutable() |
static final DataHolder NULL
@NotNull @NotNull Map<? extends DataKeyBase<?>,Object> getAll()
@NotNull @NotNull Collection<? extends DataKeyBase<?>> getKeys()
boolean contains(@NotNull
@NotNull DataKeyBase<?> key)
@Deprecated @Nullable default <T> T get(@NotNull @NotNull DataKey<T> key)
T - Type returned by keykey - data key@NotNull default @NotNull MutableDataHolder setIn(@NotNull @NotNull MutableDataHolder dataHolder)
setIn in interface MutableDataSetterObject getOrCompute(@NotNull @NotNull DataKeyBase<?> key, @NotNull @NotNull DataValueFactory<?> factory)
Method used by DataKey classes to access data.
NOTE: MutableDataHolders will compute an absent key and add it to its dataSet. DataHolders will return computed value but not change contained dataSet because they are immutable. So value will be computed every time it is requested.
key - data keyfactory - factory taking this data holder and computing/providing default value@NotNull @NotNull MutableDataHolder toMutable()
@NotNull @NotNull DataHolder toImmutable()
@NotNull default @NotNull DataSet toDataSet()
Copyright © 2020. All rights reserved.