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 voidclose()TgetValue()booleanhasValue()StringtoString()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:
closein interfaceAutoCloseable- Specified by:
closein interfaceSdkAutoCloseable
-
-