> ## Documentation Index
> Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Java: Token

> CDKTN Core API Reference for Token in Java.

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.

## Initializers <a name="Initializers" id="cdktn.Token.Initializer" />

```java theme={null}
import io.cdktn.cdktn.Token;

new Token();
```

| **Name** | **Type** | **Description** |
| -------- | -------- | --------------- |

***

## Static Functions <a name="Static Functions" id="Static Functions" />

| **Name**                                                          | **Description**                                          |
| ----------------------------------------------------------------- | -------------------------------------------------------- |
| <code><a href="#cdktn.Token.asAny">asAny</a></code>               | Return a resolvable representation of the given value.   |
| <code><a href="#cdktn.Token.asAnyMap">asAnyMap</a></code>         | Return a reversible map representation of this token.    |
| <code><a href="#cdktn.Token.asBooleanMap">asBooleanMap</a></code> | Return a reversible map representation of this token.    |
| <code><a href="#cdktn.Token.asList">asList</a></code>             | Return a reversible list representation of this token.   |
| <code><a href="#cdktn.Token.asMap">asMap</a></code>               | Return a reversible map representation of this token.    |
| <code><a href="#cdktn.Token.asNumber">asNumber</a></code>         | Return a reversible number representation of this token. |
| <code><a href="#cdktn.Token.asNumberList">asNumberList</a></code> | Return a reversible list representation of this token.   |
| <code><a href="#cdktn.Token.asNumberMap">asNumberMap</a></code>   | Return a reversible map representation of this token.    |
| <code><a href="#cdktn.Token.asString">asString</a></code>         | Return a reversible string representation of this token. |
| <code><a href="#cdktn.Token.asStringMap">asStringMap</a></code>   | Return a reversible map representation of this token.    |
| <code><a href="#cdktn.Token.isUnresolved">isUnresolved</a></code> | Returns true if obj represents an unresolved value.      |
| <code><a href="#cdktn.Token.nullValue">nullValue</a></code>       | Return a Token containing a `null` value.                |

***

### `asAny` <a name="asAny" id="cdktn.Token.asAny" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.asAny(java.lang.Object value)
```

Return a resolvable representation of the given value.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asAny.parameter.value" />

* *Type:* java.lang.Object

***

### `asAnyMap` <a name="asAnyMap" id="cdktn.Token.asAnyMap" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.asAnyMap(java.lang.Object value),Token.asAnyMap(java.lang.Object value, EncodingOptions options)
```

Return a reversible map representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asAnyMap.parameter.value" />

* *Type:* java.lang.Object

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asAnyMap.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `asBooleanMap` <a name="asBooleanMap" id="cdktn.Token.asBooleanMap" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.asBooleanMap(java.lang.Object value),Token.asBooleanMap(java.lang.Object value, EncodingOptions options)
```

Return a reversible map representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asBooleanMap.parameter.value" />

* *Type:* java.lang.Object

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asBooleanMap.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `asList` <a name="asList" id="cdktn.Token.asList" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.asList(java.lang.Object value),Token.asList(java.lang.Object value, EncodingOptions options)
```

Return a reversible list representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asList.parameter.value" />

* *Type:* java.lang.Object

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asList.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `asMap` <a name="asMap" id="cdktn.Token.asMap" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.asMap(java.lang.Object value, java.lang.Object mapValue),Token.asMap(java.lang.Object value, java.lang.Object mapValue, EncodingOptions options)
```

Return a reversible map representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asMap.parameter.value" />

* *Type:* java.lang.Object

***

#### `mapValue`<sup>Required</sup> <a name="mapValue" id="cdktn.Token.asMap.parameter.mapValue" />

* *Type:* java.lang.Object

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asMap.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `asNumber` <a name="asNumber" id="cdktn.Token.asNumber" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.asNumber(java.lang.Object value)
```

Return a reversible number representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asNumber.parameter.value" />

* *Type:* java.lang.Object

***

### `asNumberList` <a name="asNumberList" id="cdktn.Token.asNumberList" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.asNumberList(java.lang.Object value)
```

Return a reversible list representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asNumberList.parameter.value" />

* *Type:* java.lang.Object

***

### `asNumberMap` <a name="asNumberMap" id="cdktn.Token.asNumberMap" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.asNumberMap(java.lang.Object value),Token.asNumberMap(java.lang.Object value, EncodingOptions options)
```

Return a reversible map representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asNumberMap.parameter.value" />

* *Type:* java.lang.Object

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asNumberMap.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `asString` <a name="asString" id="cdktn.Token.asString" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.asString(java.lang.Object value),Token.asString(java.lang.Object value, 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.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asString.parameter.value" />

* *Type:* java.lang.Object

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asString.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `asStringMap` <a name="asStringMap" id="cdktn.Token.asStringMap" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.asStringMap(java.lang.Object value),Token.asStringMap(java.lang.Object value, EncodingOptions options)
```

Return a reversible map representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asStringMap.parameter.value" />

* *Type:* java.lang.Object

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asStringMap.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `isUnresolved` <a name="isUnresolved" id="cdktn.Token.isUnresolved" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.isUnresolved(java.lang.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
containing resolvables.

#### `obj`<sup>Required</sup> <a name="obj" id="cdktn.Token.isUnresolved.parameter.obj" />

* *Type:* java.lang.Object

The object to test.

***

### `nullValue` <a name="nullValue" id="cdktn.Token.nullValue" />

```java theme={null}
import io.cdktn.cdktn.Token;

Token.nullValue()
```

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)

## Constants <a name="Constants" id="Constants" />

| **Name**                                                                                          | **Type**                      | **Description**                        |
| ------------------------------------------------------------------------------------------------- | ----------------------------- | -------------------------------------- |
| <code><a href="#cdktn.Token.property.ANY_MAP_TOKEN_VALUE">ANY\_MAP\_TOKEN\_VALUE</a></code>       | <code>java.lang.String</code> | Any map token representation.          |
| <code><a href="#cdktn.Token.property.NUMBER_MAP_TOKEN_VALUE">NUMBER\_MAP\_TOKEN\_VALUE</a></code> | <code>java.lang.Number</code> | Number Map token value representation. |
| <code><a href="#cdktn.Token.property.STRING_MAP_TOKEN_VALUE">STRING\_MAP\_TOKEN\_VALUE</a></code> | <code>java.lang.String</code> | String Map token value representation. |

***

### `ANY_MAP_TOKEN_VALUE`<sup>Required</sup> <a name="ANY_MAP_TOKEN_VALUE" id="cdktn.Token.property.ANY_MAP_TOKEN_VALUE" />

```java theme={null}
public java.lang.String getAnyMapTokenValue();
```

* *Type:* java.lang.String

Any map token representation.

***

### `NUMBER_MAP_TOKEN_VALUE`<sup>Required</sup> <a name="NUMBER_MAP_TOKEN_VALUE" id="cdktn.Token.property.NUMBER_MAP_TOKEN_VALUE" />

```java theme={null}
public java.lang.Number getNumberMapTokenValue();
```

* *Type:* java.lang.Number

Number Map token value representation.

***

### `STRING_MAP_TOKEN_VALUE`<sup>Required</sup> <a name="STRING_MAP_TOKEN_VALUE" id="cdktn.Token.property.STRING_MAP_TOKEN_VALUE" />

```java theme={null}
public java.lang.String getStringMapTokenValue();
```

* *Type:* java.lang.String

String Map token value representation.

***
