Package software.amazon.awssdk.utils
Class Lazy<T>
- java.lang.Object
-
- software.amazon.awssdk.utils.Lazy<T>
-
- All Implemented Interfaces:
AutoCloseable
,SdkAutoCloseable
public class Lazy<T> extends Object implements SdkAutoCloseable
A class that lazily constructs a value the first timegetValue()
is invoked. This should beclose()
d if the initializer returns value that needs to beAutoCloseable.close()
d.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
T
getValue()
boolean
hasValue()
String
toString()
static <T> Lazy<T>
withValue(T initialValue)
-
-
-
Method Detail
-
withValue
public static <T> Lazy<T> withValue(T initialValue)
-
hasValue
public boolean hasValue()
-
getValue
public T getValue()
-
close
public void close()
Description copied from interface:SdkAutoCloseable
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-
-