public interface MutableDataHolder extends DataHolder, MutableDataSetter
| Modifier and Type | Method and Description |
|---|---|
MutableDataHolder |
clear()
clear all options out of the data set
|
<T> T |
get(DataKey<T> key)
Get the given key, if it does not exist then use the key's factory to create a new value and put it into the collection
so that the following get of the same key will find a value
|
<T> T |
getOrCompute(DataKey<T> key)
Will return the value previously set or generate a new value using the given factory.
|
<T> MutableDataHolder |
remove(DataKey<T> key)
Remove the stored value for the key, used to force to default or to force recompute
|
<T> MutableDataHolder |
set(DataKey<? extends T> key,
T value)
Store the given value for the key
|
MutableDataHolder |
setAll(DataHolder other)
Copy all values from one data holder to this data holder
|
MutableDataHolder |
setFrom(MutableDataSetter dataSetter)
Store the given value for the key
|
MutableDataHolder |
setIn(MutableDataHolder dataHolder)
Set options in given mutable data hoer
|
contains, getAll, getKeys, keySet, toImmutable, toMutable<T> T get(DataKey<T> key)
get in interface DataHolderkey - data key<T> MutableDataHolder set(DataKey<? extends T> key, T value)
T - data type of the data referred by the keykey - data keyvalue - value to store<T> MutableDataHolder remove(DataKey<T> key)
T - data type of the data referred by the keykey - data key to removeMutableDataHolder setFrom(MutableDataSetter dataSetter)
dataSetter - data setter which will set valuesMutableDataHolder setAll(DataHolder other)
other - data holder from which to copy all valuesMutableDataHolder setIn(MutableDataHolder dataHolder)
setIn in interface MutableDataSetterdataHolder - data holder where to copy options from this data holder<T> T getOrCompute(DataKey<T> key)
NOTE: if a new value is generated it will be stored for the given key so that subsequent calls with the same parameters will return the same value as the first call that generated the new value.
T - data type of the data referred by the keykey - data key identifying the dataMutableDataHolder clear()
Copyright © 2019. All rights reserved.