Class Token
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic IResolvable
Return a resolvable representation of the given value.Return a reversible list representation of this token.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.static TokenComparison
compareStrings
(String possibleToken1, String possibleToken2) Compare two strings that might contain Tokens with each other.static Boolean
isUnresolved
(Object obj) 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
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
Return a reversible list representation of this token.- Parameters:
value
- This parameter is required.
-
asNumber
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
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
Returns true if obj represents an unresolved value.One of these must be true:
obj
is an IResolvableobj
is a string containing at least one encodedIResolvable
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.
-