Class Tokenization
Less oft-needed functions to manipulate Tokens.
Inheritance
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Tokenization : DeputyBase
Syntax (vb)
Public Class Tokenization
Inherits DeputyBase
Synopsis
Constructors
Tokenization(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Tokenization(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
IsResolvable(Object) | Return whether the given object is an IResolvable object. |
Resolve(Object, IResolveOptions) | Resolves an object by evaluating all tokens and removing any undefined or empty objects or arrays. |
Reverse(Object, IReverseOptions) | Reverse any value into a Resolvable, if possible. |
ReverseCompleteString(String) | Un-encode a string which is either a complete encoded token, or doesn't contain tokens at all. |
ReverseList(String[]) | Un-encode a Tokenized value from a list. |
ReverseNumber(Double) | Un-encode a Tokenized value from a number. |
ReverseString(String) | Un-encode a string potentially containing encoded tokens. |
StringifyNumber(Double) | Stringify a number directly or lazily if it's a Token. |
Constructors
Tokenization(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Tokenization(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Tokenization(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Tokenization(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
IsResolvable(Object)
Return whether the given object is an IResolvable object.
public static bool IsResolvable(object obj)
Parameters
- obj System.Object
Returns
System.Boolean
Remarks
This is different from Token.isUnresolved() which will also check for encoded Tokens, whereas this method will only do a type check on the given object.
Resolve(Object, IResolveOptions)
Resolves an object by evaluating all tokens and removing any undefined or empty objects or arrays.
public static object Resolve(object obj, IResolveOptions options)
Parameters
- obj System.Object
The object to resolve.
- options IResolveOptions
Prefix key path components for diagnostics.
Returns
System.Object
Remarks
Values can only be primitives, arrays or tokens. Other objects (i.e. with methods) will be rejected.
Reverse(Object, IReverseOptions)
Reverse any value into a Resolvable, if possible.
public static IResolvable Reverse(object x, IReverseOptions options = null)
Parameters
- x System.Object
- options IReverseOptions
Returns
Remarks
In case of a string, the string must not be a concatenation.
ReverseCompleteString(String)
Un-encode a string which is either a complete encoded token, or doesn't contain tokens at all.
public static IResolvable ReverseCompleteString(string s)
Parameters
- s System.String
Returns
Remarks
It's illegal for the string to be a concatenation of an encoded token and something else.
ReverseList(String[])
Un-encode a Tokenized value from a list.
public static IResolvable ReverseList(string[] l)
Parameters
- l System.String[]
Returns
ReverseNumber(Double)
Un-encode a Tokenized value from a number.
public static IResolvable ReverseNumber(double n)
Parameters
- n System.Double
Returns
ReverseString(String)
Un-encode a string potentially containing encoded tokens.
public static TokenizedStringFragments ReverseString(string s)
Parameters
- s System.String
Returns
StringifyNumber(Double)
Stringify a number directly or lazily if it's a Token.
public static string StringifyNumber(double x)
Parameters
- x System.Double
Returns
System.String
Remarks
If it is an object (i.e., { Ref: 'SomeLogicalId' }), return it as-is.