@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)",
date="2022-05-27T16:27:54.135Z")
public class Token
extends software.amazon.jsii.JsiiObject
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.
Modifier | Constructor and Description |
---|---|
protected |
Token(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Token(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
static IResolvable |
asAny(java.lang.Object value)
Return a resolvable representation of the given value.
|
static java.util.List<java.lang.String> |
asList(java.lang.Object value)
Return a reversible list representation of this token.
|
static java.util.List<java.lang.String> |
asList(java.lang.Object value,
EncodingOptions options)
Return a reversible list representation of this token.
|
static java.lang.Number |
asNumber(java.lang.Object value)
Return a reversible number representation of this token.
|
static java.lang.String |
asString(java.lang.Object value)
Return a reversible string representation of this token.
|
static java.lang.String |
asString(java.lang.Object value,
EncodingOptions options)
Return a reversible string representation of this token.
|
static TokenComparison |
compareStrings(java.lang.String possibleToken1,
java.lang.String possibleToken2)
Compare two strings that might contain Tokens with each other.
|
static java.lang.Boolean |
isUnresolved(java.lang.Object obj)
Returns true if obj represents an unresolved value.
|
protected Token(software.amazon.jsii.JsiiObjectRef objRef)
protected Token(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public static IResolvable asAny(java.lang.Object value)
value
- This parameter is required.public static java.util.List<java.lang.String> asList(java.lang.Object value, EncodingOptions options)
value
- This parameter is required.options
- public static java.util.List<java.lang.String> asList(java.lang.Object value)
value
- This parameter is required.public static java.lang.Number asNumber(java.lang.Object value)
value
- This parameter is required.public static java.lang.String asString(java.lang.Object value, EncodingOptions options)
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.
value
- This parameter is required.options
- public static java.lang.String asString(java.lang.Object value)
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.
value
- This parameter is required.public static TokenComparison compareStrings(java.lang.String possibleToken1, java.lang.String possibleToken2)
possibleToken1
- This parameter is required.possibleToken2
- This parameter is required.public static java.lang.Boolean isUnresolved(java.lang.Object obj)
One of these must be true:
obj
is an IResolvableobj
is a string containing at least one encoded IResolvable
obj
is either an encoded number or listThis does NOT recurse into lists or objects to see if they containing resolvables.
obj
- The object to test. This parameter is required.