Class Token

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

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-11T15:55:52.150Z") @Stability(Stable) public class Token extends software.amazon.jsii.JsiiObject
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.

  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Token(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Token(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    asAny(Object value)
    Return a resolvable representation of the given value.
    static List<String>
    asList(Object value)
    Return a reversible list representation of this token.
    static List<String>
    asList(Object value, EncodingOptions options)
    Return a reversible list representation of this token.
    static Number
    Return a reversible number representation of this token.
    static String
    Return a reversible string representation of this token.
    static String
    asString(Object value, EncodingOptions options)
    Return a reversible string representation of this token.
    compareStrings(String possibleToken1, String possibleToken2)
    Compare two strings that might contain Tokens with each other.
    static Boolean
    Returns true if obj represents an unresolved value.

    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

    • Token

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

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

    • asAny

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

      Parameters:
      value - This parameter is required.
    • asList

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

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

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

      Parameters:
      value - This parameter is required.
    • asNumber

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

      Parameters:
      value - This parameter is required.
    • asString

      @Stability(Stable) @NotNull public static String asString(@NotNull Object value, @Nullable EncodingOptions options)
      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(Stable) @NotNull public static String asString(@NotNull Object value)
      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.
    • compareStrings

      @Stability(Stable) @NotNull public static TokenComparison compareStrings(@NotNull String possibleToken1, @NotNull String possibleToken2)
      Compare two strings that might contain Tokens with each other.

      Parameters:
      possibleToken1 - This parameter is required.
      possibleToken2 - This parameter is required.
    • isUnresolved

      @Stability(Stable) @NotNull public static Boolean isUnresolved(@NotNull Object obj)
      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 contain resolvables.

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