Top Description Fields Constructors Methods
tech.units.indriya.internal.function

public Class Lazy<T>

extends Object
Class Inheritance
Annotations
@API
status:INTERNAL
Static Imports
org.apiguardian.api.API.Status.INTERNAL

Holder of an instance of type T, supporting the compute-if-absent idiom in a thread-safe manner.

Not serializable!

Author
Andi Huber
Since
2.0.3

Field Summary

Modifier and TypeField and Description
private boolean
private final Supplier<? extends T>
private T

Constructor Summary

AccessConstructor and Description
public
Lazy(Supplier<? extends T> supplier)

Method Summary

Modifier and TypeMethod and Description
public void
public T
get()

public boolean
public void
set(T value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

memorizedback to summary
private boolean memorized
supplierback to summary
private final Supplier<? extends T> supplier
valueback to summary
private T value

Constructor Detail

Lazyback to summary
public Lazy(Supplier<? extends T> supplier)

Method Detail

clearback to summary
public void clear()
getback to summary
public T get()
isMemorizedback to summary
public boolean isMemorized()
setback to summary
public void set(T value)