Class Token

java.lang.Object
software.amazon.jsii.JsiiObject
com.hashicorp.cdktf.Token
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.87.0 (build 9892444)", date="2023-10-13T12:41:51.283Z") @Stability(Experimental) public class Token extends software.amazon.jsii.JsiiObject
(experimental) Represents a special or lazily-evaluated value.

Can be used to delay evaluation of a certain value in case, for example, that it requires some context or late-bound data. Can also be used to mark values that need special processing at document rendering time.

Tokens can be embedded into strings while retaining their original semantics.

  • Field Details

    • ANY_MAP_TOKEN_VALUE

      @Stability(Experimental) public static final String ANY_MAP_TOKEN_VALUE
      (experimental) Any map token representation.
    • NUMBER_MAP_TOKEN_VALUE

      @Stability(Experimental) public static final Number NUMBER_MAP_TOKEN_VALUE
      (experimental) Number Map token value representation.
    • STRING_MAP_TOKEN_VALUE

      @Stability(Experimental) public static final String STRING_MAP_TOKEN_VALUE
      (experimental) String Map token value representation.
  • Constructor Details

    • Token

      protected Token(software.amazon.jsii.JsiiObjectRef objRef)
    • Token

      protected Token(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Token

      @Stability(Experimental) public Token()
  • Method Details

    • asAny

      @Stability(Experimental) @NotNull public static IResolvable asAny(@NotNull Object value)
      (experimental) Return a resolvable representation of the given value.

      Parameters:
      value - This parameter is required.
    • asAnyMap

      @Stability(Experimental) @NotNull public static Map<String,Object> asAnyMap(@NotNull Object value, @Nullable EncodingOptions options)
      (experimental) Return a reversible map representation of this token.

      Parameters:
      value - This parameter is required.
      options -
    • asAnyMap

      @Stability(Experimental) @NotNull public static Map<String,Object> asAnyMap(@NotNull Object value)
      (experimental) Return a reversible map representation of this token.

      Parameters:
      value - This parameter is required.
    • asBooleanMap

      @Stability(Experimental) @NotNull public static Map<String,Boolean> asBooleanMap(@NotNull Object value, @Nullable EncodingOptions options)
      (experimental) Return a reversible map representation of this token.

      Parameters:
      value - This parameter is required.
      options -
    • asBooleanMap

      @Stability(Experimental) @NotNull public static Map<String,Boolean> asBooleanMap(@NotNull Object value)
      (experimental) Return a reversible map representation of this token.

      Parameters:
      value - This parameter is required.
    • asList

      @Stability(Experimental) @NotNull public static List<String> asList(@NotNull Object value, @Nullable EncodingOptions options)
      (experimental) Return a reversible list representation of this token.

      Parameters:
      value - This parameter is required.
      options -
    • asList

      @Stability(Experimental) @NotNull public static List<String> asList(@NotNull Object value)
      (experimental) Return a reversible list representation of this token.

      Parameters:
      value - This parameter is required.
    • asMap

      @Stability(Experimental) @NotNull public static Map<String,Object> asMap(@NotNull Object value, @NotNull Object mapValue, @Nullable EncodingOptions options)
      (experimental) Return a reversible map representation of this token.

      Parameters:
      value - This parameter is required.
      mapValue - This parameter is required.
      options -
    • asMap

      @Stability(Experimental) @NotNull public static Map<String,Object> asMap(@NotNull Object value, @NotNull Object mapValue)
      (experimental) Return a reversible map representation of this token.

      Parameters:
      value - This parameter is required.
      mapValue - This parameter is required.
    • asNumber

      @Stability(Experimental) @NotNull public static Number asNumber(@NotNull Object value)
      (experimental) Return a reversible number representation of this token.

      Parameters:
      value - This parameter is required.
    • asNumberList

      @Stability(Experimental) @NotNull public static List<Number> asNumberList(@NotNull Object value)
      (experimental) Return a reversible list representation of this token.

      Parameters:
      value - This parameter is required.
    • asNumberMap

      @Stability(Experimental) @NotNull public static Map<String,Number> asNumberMap(@NotNull Object value, @Nullable EncodingOptions options)
      (experimental) Return a reversible map representation of this token.

      Parameters:
      value - This parameter is required.
      options -
    • asNumberMap

      @Stability(Experimental) @NotNull public static Map<String,Number> asNumberMap(@NotNull Object value)
      (experimental) Return a reversible map representation of this token.

      Parameters:
      value - This parameter is required.
    • asString

      @Stability(Experimental) @NotNull public static String asString(@NotNull Object value, @Nullable EncodingOptions options)
      (experimental) Return a reversible string representation of this token.

      If the Token is initialized with a literal, the stringified value of the literal is returned. Otherwise, a special quoted string representation of the Token is returned that can be embedded into other strings.

      Strings with quoted Tokens in them can be restored back into complex values with the Tokens restored by calling resolve() on the string.

      Parameters:
      value - This parameter is required.
      options -
    • asString

      @Stability(Experimental) @NotNull public static String asString(@NotNull Object value)
      (experimental) Return a reversible string representation of this token.

      If the Token is initialized with a literal, the stringified value of the literal is returned. Otherwise, a special quoted string representation of the Token is returned that can be embedded into other strings.

      Strings with quoted Tokens in them can be restored back into complex values with the Tokens restored by calling resolve() on the string.

      Parameters:
      value - This parameter is required.
    • asStringMap

      @Stability(Experimental) @NotNull public static Map<String,String> asStringMap(@NotNull Object value, @Nullable EncodingOptions options)
      (experimental) Return a reversible map representation of this token.

      Parameters:
      value - This parameter is required.
      options -
    • asStringMap

      @Stability(Experimental) @NotNull public static Map<String,String> asStringMap(@NotNull Object value)
      (experimental) Return a reversible map representation of this token.

      Parameters:
      value - This parameter is required.
    • isUnresolved

      @Stability(Experimental) @NotNull public static Boolean isUnresolved(@NotNull Object obj)
      (experimental) Returns true if obj represents an unresolved value.

      One of these must be true:

      • obj is an IResolvable
      • obj is a string containing at least one encoded IResolvable
      • obj is either an encoded number or list

      This does NOT recurse into lists or objects to see if they containing resolvables.

      Parameters:
      obj - The object to test. This parameter is required.
    • nullValue

      @Stability(Experimental) @NotNull public static IResolvable nullValue()
      (experimental) Return a Token containing a null value.

      Note: This is different than undefined, nil, None or similar as it will end up in the Terraform config and can be used to explicitly not set an attribute (which is sometimes required by Terraform providers)

      Returns:
      a Token resolving to null as understood by Terraform