public abstract class LazyValue<T>
extends java.lang.Object
implements java.util.function.Supplier<T>
T
.
LazyValue
implements an evaluate by need semantics:
createValue()
is called exactly once when get()
is called for the first time.
LazyValue
instances are thread safe.
Constructor and Description |
---|
LazyValue() |
Modifier and Type | Method and Description |
---|---|
T |
get()
Get value.
|
boolean |
hasValue() |
public boolean hasValue()
true
iff get()
has been called at least once.public T get()
createValue()
if called for the first time.get
in interface java.util.function.Supplier<T>
Copyright © 2010 - 2020 Adobe. All Rights Reserved