public class ValueContainer<TValue> extends Object
| Constructor and Description |
|---|
ValueContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearValue()
Clears the
value and marks this ValueContainer has not having a value. |
TValue |
getValue()
Returns the
value. |
boolean |
hasValue()
Determines if this containers
value has been set at one point in time. |
void |
ifPresent(@NotNull Consumer<TValue> consumer)
Calls the given
Consumer if this ValueContainer currently has a value. |
void |
setValue(TValue value)
Sets the
value and also marks this ValueContainer as having a value. |
public boolean hasValue()
value has been set at one point in time.value has been set, otherwise false.public void setValue(@Nullable
TValue value)
value and also marks this ValueContainer as having a value.value - the value that is to bet set.public void clearValue()
value and marks this ValueContainer has not having a value.public void ifPresent(@NotNull
@NotNull Consumer<TValue> consumer)
Consumer if this ValueContainer currently has a value.consumer - the Consumer to use for this ValueContainers value if it has one.Copyright © 2016 Saxonia Systems AG. All rights reserved.