Class Lazy
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
Can be used to return a string, list or numeric value whose actual value will only be calculated later, during synthesis.
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IResolvable
any
(IStableAnyProducer producer) Defer the one-time calculation of an arbitrarily typed value to synthesis time.static IResolvable
any
(IStableAnyProducer producer, LazyAnyValueOptions options) Defer the one-time calculation of an arbitrarily typed value to synthesis time.list
(IStableListProducer producer) Defer the one-time calculation of a list value to synthesis time.list
(IStableListProducer producer, LazyListValueOptions options) Defer the one-time calculation of a list value to synthesis time.static Number
number
(IStableNumberProducer producer) Defer the one-time calculation of a number value to synthesis time.static String
string
(IStableStringProducer producer) Defer the one-time calculation of a string value to synthesis time.static String
string
(IStableStringProducer producer, LazyStringValueOptions options) Defer the one-time calculation of a string value to synthesis time.static IResolvable
uncachedAny
(IAnyProducer producer) Defer the calculation of an untyped value to synthesis time.static IResolvable
uncachedAny
(IAnyProducer producer, LazyAnyValueOptions options) Defer the calculation of an untyped value to synthesis time.uncachedList
(IListProducer producer) Defer the calculation of a list value to synthesis time.uncachedList
(IListProducer producer, LazyListValueOptions options) Defer the calculation of a list value to synthesis time.static Number
uncachedNumber
(INumberProducer producer) Defer the calculation of a number value to synthesis time.static String
uncachedString
(IStringProducer producer) Defer the calculation of a string value to synthesis time.static String
uncachedString
(IStringProducer producer, LazyStringValueOptions options) Defer the calculation of a string value to synthesis time.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
Lazy
protected Lazy(software.amazon.jsii.JsiiObjectRef objRef) -
Lazy
protected Lazy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
any
@Stability(Stable) @NotNull public static IResolvable any(@NotNull IStableAnyProducer producer, @Nullable LazyAnyValueOptions options) Defer the one-time calculation of an arbitrarily typed value to synthesis time.Use this if you want to render an object to a template whose actual value depends on some state mutation that may happen after the construct has been created.
The inner function will only be invoked one time and cannot depend on resolution context.
- Parameters:
producer
- This parameter is required.options
-
-
any
Defer the one-time calculation of an arbitrarily typed value to synthesis time.Use this if you want to render an object to a template whose actual value depends on some state mutation that may happen after the construct has been created.
The inner function will only be invoked one time and cannot depend on resolution context.
- Parameters:
producer
- This parameter is required.
-
list
@Stability(Stable) @NotNull public static List<String> list(@NotNull IStableListProducer producer, @Nullable LazyListValueOptions options) Defer the one-time calculation of a list value to synthesis time.Use this if you want to render a list to a template whose actual value depends on some state mutation that may happen after the construct has been created.
If you are simply looking to force a value to a
string[]
type and don't need the calculation to be deferred, useToken.asList()
instead.The inner function will only be invoked once, and the resolved value cannot depend on the Stack the Token is used in.
- Parameters:
producer
- This parameter is required.options
-
-
list
Defer the one-time calculation of a list value to synthesis time.Use this if you want to render a list to a template whose actual value depends on some state mutation that may happen after the construct has been created.
If you are simply looking to force a value to a
string[]
type and don't need the calculation to be deferred, useToken.asList()
instead.The inner function will only be invoked once, and the resolved value cannot depend on the Stack the Token is used in.
- Parameters:
producer
- This parameter is required.
-
number
Defer the one-time calculation of a number value to synthesis time.Use this if you want to render a number to a template whose actual value depends on some state mutation that may happen after the construct has been created.
If you are simply looking to force a value to a
number
type and don't need the calculation to be deferred, useToken.asNumber()
instead.The inner function will only be invoked once, and the resolved value cannot depend on the Stack the Token is used in.
- Parameters:
producer
- This parameter is required.
-
string
@Stability(Stable) @NotNull public static String string(@NotNull IStableStringProducer producer, @Nullable LazyStringValueOptions options) Defer the one-time calculation of a string value to synthesis time.Use this if you want to render a string to a template whose actual value depends on some state mutation that may happen after the construct has been created.
If you are simply looking to force a value to a
string
type and don't need the calculation to be deferred, useToken.asString()
instead.The inner function will only be invoked once, and the resolved value cannot depend on the Stack the Token is used in.
- Parameters:
producer
- This parameter is required.options
-
-
string
Defer the one-time calculation of a string value to synthesis time.Use this if you want to render a string to a template whose actual value depends on some state mutation that may happen after the construct has been created.
If you are simply looking to force a value to a
string
type and don't need the calculation to be deferred, useToken.asString()
instead.The inner function will only be invoked once, and the resolved value cannot depend on the Stack the Token is used in.
- Parameters:
producer
- This parameter is required.
-
uncachedAny
@Stability(Stable) @NotNull public static IResolvable uncachedAny(@NotNull IAnyProducer producer, @Nullable LazyAnyValueOptions options) Defer the calculation of an untyped value to synthesis time.Use of this function is not recommended; unless you know you need it for sure, you probably don't. Use
Lazy.any()
instead.The inner function may be invoked multiple times during synthesis. You should only use this method if the returned value depends on variables that may change during the Aspect application phase of synthesis, or if the value depends on the Stack the value is being used in. Both of these cases are rare, and only ever occur for AWS Construct Library authors.
- Parameters:
producer
- This parameter is required.options
-
-
uncachedAny
Defer the calculation of an untyped value to synthesis time.Use of this function is not recommended; unless you know you need it for sure, you probably don't. Use
Lazy.any()
instead.The inner function may be invoked multiple times during synthesis. You should only use this method if the returned value depends on variables that may change during the Aspect application phase of synthesis, or if the value depends on the Stack the value is being used in. Both of these cases are rare, and only ever occur for AWS Construct Library authors.
- Parameters:
producer
- This parameter is required.
-
uncachedList
@Stability(Stable) @NotNull public static List<String> uncachedList(@NotNull IListProducer producer, @Nullable LazyListValueOptions options) Defer the calculation of a list value to synthesis time.Use of this function is not recommended; unless you know you need it for sure, you probably don't. Use
Lazy.list()
instead.The inner function may be invoked multiple times during synthesis. You should only use this method if the returned value depends on variables that may change during the Aspect application phase of synthesis, or if the value depends on the Stack the value is being used in. Both of these cases are rare, and only ever occur for AWS Construct Library authors.
- Parameters:
producer
- This parameter is required.options
-
-
uncachedList
@Stability(Stable) @NotNull public static List<String> uncachedList(@NotNull IListProducer producer) Defer the calculation of a list value to synthesis time.Use of this function is not recommended; unless you know you need it for sure, you probably don't. Use
Lazy.list()
instead.The inner function may be invoked multiple times during synthesis. You should only use this method if the returned value depends on variables that may change during the Aspect application phase of synthesis, or if the value depends on the Stack the value is being used in. Both of these cases are rare, and only ever occur for AWS Construct Library authors.
- Parameters:
producer
- This parameter is required.
-
uncachedNumber
Defer the calculation of a number value to synthesis time.Use of this function is not recommended; unless you know you need it for sure, you probably don't. Use
Lazy.number()
instead.The inner function may be invoked multiple times during synthesis. You should only use this method if the returned value depends on variables that may change during the Aspect application phase of synthesis, or if the value depends on the Stack the value is being used in. Both of these cases are rare, and only ever occur for AWS Construct Library authors.
- Parameters:
producer
- This parameter is required.
-
uncachedString
@Stability(Stable) @NotNull public static String uncachedString(@NotNull IStringProducer producer, @Nullable LazyStringValueOptions options) Defer the calculation of a string value to synthesis time.Use of this function is not recommended; unless you know you need it for sure, you probably don't. Use
Lazy.string()
instead.The inner function may be invoked multiple times during synthesis. You should only use this method if the returned value depends on variables that may change during the Aspect application phase of synthesis, or if the value depends on the Stack the value is being used in. Both of these cases are rare, and only ever occur for AWS Construct Library authors.
- Parameters:
producer
- This parameter is required.options
-
-
uncachedString
Defer the calculation of a string value to synthesis time.Use of this function is not recommended; unless you know you need it for sure, you probably don't. Use
Lazy.string()
instead.The inner function may be invoked multiple times during synthesis. You should only use this method if the returned value depends on variables that may change during the Aspect application phase of synthesis, or if the value depends on the Stack the value is being used in. Both of these cases are rare, and only ever occur for AWS Construct Library authors.
- Parameters:
producer
- This parameter is required.
-