public class AssumedValue<T> extends Object
Compiled code that uses the value will be invalidated each time the value changes, so you should take care to only change values infrequently, or to monitor the number of times the value has changed and at some point to replace the value with something more generic so that it does not have to be changed and code does not have to keep being recompiled.
Constructor and Description |
---|
AssumedValue(String name,
T initialValue) |
AssumedValue(T initialValue) |
Modifier and Type | Method and Description |
---|---|
T |
get()
Get the current value, updating it if it has been
AssumedValue.set(T) . |
void |
set(T newValue)
Set a new value, which will be picked up the next time
AssumedValue.get() is called. |
public AssumedValue(T initialValue)
public T get()
AssumedValue.set(T)
. The compiler may be able to
make this method return a constant value, but still accommodate mutation.public void set(T newValue)
AssumedValue.get()
is called.