public class MutableDataSet extends DataSet implements MutableDataHolder
NULL| Constructor and Description |
|---|
MutableDataSet() |
MutableDataSet(@Nullable DataHolder other) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull MutableDataSet |
clear()
clear all options out of the data set
|
@Nullable Object |
getOrCompute(@NotNull DataKeyBase<?> key,
@NotNull DataValueFactory<?> factory)
Get key if it exists or compute using supplier
|
static MutableDataSet |
merge(DataHolder... dataHolders) |
@NotNull MutableDataSet |
remove(@NotNull DataKeyBase<?> key)
Remove the stored value for the key, used to force to default or to force recompute
|
<T> @NotNull MutableDataSet |
set(@NotNull DataKey<T> key,
T value)
Store the given value for the key
|
<T> @NotNull MutableDataSet |
set(@NotNull NullableDataKey<T> key,
T value)
Store the given value for the key
|
@NotNull MutableDataSet |
setAll(@NotNull DataHolder other)
Copy all values from one data holder to this data holder
|
@NotNull MutableDataSet |
setFrom(@NotNull MutableDataSetter dataSetter)
Store the given value for the key
|
@NotNull MutableDataHolder |
setIn(@NotNull MutableDataHolder dataHolder)
Set options in given mutable data holder
|
@NotNull MutableDataSet |
toDataSet() |
@NotNull DataSet |
toImmutable() |
@NotNull MutableDataSet |
toMutable() |
aggregate, aggregate, aggregateActions, contains, equals, getAll, getKeys, hashCode, registerDataKeyAggregator, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetcontains, getAll, getKeyspublic MutableDataSet()
public MutableDataSet(@Nullable
@Nullable DataHolder other)
@NotNull public <T> @NotNull MutableDataSet set(@NotNull @NotNull DataKey<T> key, @NotNull T value)
MutableDataHolderset in interface MutableDataHolderT - data type of the data referred by the keykey - data keyvalue - value to store@NotNull public <T> @NotNull MutableDataSet set(@NotNull @NotNull NullableDataKey<T> key, @Nullable T value)
MutableDataHolderset in interface MutableDataHolderT - data type of the data referred by the keykey - data keyvalue - value to store@NotNull public @NotNull MutableDataSet setFrom(@NotNull @NotNull MutableDataSetter dataSetter)
MutableDataHoldersetFrom in interface MutableDataHolderdataSetter - data setter which will set values@NotNull public @NotNull MutableDataSet setAll(@NotNull @NotNull DataHolder other)
MutableDataHoldersetAll in interface MutableDataHolderother - data holder from which to copy all valuespublic static MutableDataSet merge(DataHolder... dataHolders)
@NotNull public @NotNull MutableDataHolder setIn(@NotNull @NotNull MutableDataHolder dataHolder)
MutableDataHoldersetIn in interface DataHoldersetIn in interface MutableDataHoldersetIn in interface MutableDataSetterdataHolder - data holder where to copy options from this data holder@NotNull public @NotNull MutableDataSet remove(@NotNull @NotNull DataKeyBase<?> key)
MutableDataHolderremove in interface MutableDataHolderkey - data key to remove@Nullable public @Nullable Object getOrCompute(@NotNull @NotNull DataKeyBase<?> key, @NotNull @NotNull DataValueFactory<?> factory)
DataHolderMethod 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.
getOrCompute in interface DataHoldergetOrCompute in interface MutableDataHoldergetOrCompute in class DataSetkey - data keyfactory - factory taking this data holder and computing/providing default value@NotNull public @NotNull MutableDataSet toMutable()
toMutable in interface DataHoldertoMutable in class DataSet@NotNull public @NotNull DataSet toImmutable()
toImmutable in interface DataHoldertoImmutable in class DataSet@NotNull public @NotNull MutableDataSet toDataSet()
toDataSet in interface DataHoldertoDataSet in class DataSet@NotNull public @NotNull MutableDataSet clear()
MutableDataHolderclear in interface MutableDataHolderCopyright © 2020. All rights reserved.