Class Lazy

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Lazy
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-21T06:34:02.216Z") @Stability(Stable) public class Lazy extends software.amazon.jsii.JsiiObject
Lazily produce a value.

Can be used to return a string, list or numeric value whose actual value will only be calculated later, during synthesis.

  • 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

      @Stability(Stable) @NotNull public static IResolvable any(@NotNull IStableAnyProducer producer)
      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, use Token.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

      @Stability(Stable) @NotNull public static List<String> list(@NotNull IStableListProducer producer)
      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, use Token.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

      @Stability(Stable) @NotNull public static Number number(@NotNull IStableNumberProducer producer)
      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, use Token.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, use Token.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

      @Stability(Stable) @NotNull public static String string(@NotNull IStableStringProducer producer)
      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, use Token.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

      @Stability(Stable) @NotNull public static IResolvable uncachedAny(@NotNull IAnyProducer producer)
      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

      @Stability(Stable) @NotNull public static Number uncachedNumber(@NotNull INumberProducer producer)
      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

      @Stability(Stable) @NotNull public static String uncachedString(@NotNull IStringProducer producer)
      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.