public final class FutureValue<VALUE_TYPE> extends java.lang.Object implements IFutureValue<VALUE_TYPE>
Constructor and Description |
---|
FutureValue() |
FutureValue(VALUE_TYPE value) |
Modifier and Type | Method and Description |
---|---|
void |
addFutureCallback(IFutureValueCallback<VALUE_TYPE> callback)
Adds a callback that will be invoked in the following manner:
1.
|
VALUE_TYPE |
getValue()
Gets the value if the future is initialized and throw a runtime exception otherwise
|
void |
initialize(VALUE_TYPE value)
Initializes the future with a defined value.
|
boolean |
isInitialized() |
void |
removeFutureCallback(IFutureValueCallback<VALUE_TYPE> callback)
Removes a creation callback if no longer interested on the value.
|
public FutureValue()
public FutureValue(VALUE_TYPE value)
public void addFutureCallback(IFutureValueCallback<VALUE_TYPE> callback)
IFutureValue
addFutureCallback
in interface IFutureValue<VALUE_TYPE>
callback
- The callback that gets the initialized valuepublic void removeFutureCallback(IFutureValueCallback<VALUE_TYPE> callback)
IFutureValue
removeFutureCallback
in interface IFutureValue<VALUE_TYPE>
callback
- The callback to removepublic boolean isInitialized()
isInitialized
in interface IFutureValue<VALUE_TYPE>
public VALUE_TYPE getValue()
IFutureValue
getValue
in interface IFutureValue<VALUE_TYPE>
public void initialize(VALUE_TYPE value)
value
- The value to initialize the future with, may be nulljava.lang.IllegalStateException
- if the future was already initializedSiehe auch Jowidgets Nutzerhandbuch