# Class JsonWebToken.Payload (2.1.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.1.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Payload)
- [2.0.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/2.0.3/com.google.api.client.json.webtoken.JsonWebToken.Payload)
- [1.47.1](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.47.1/com.google.api.client.json.webtoken.JsonWebToken.Payload)
- [1.46.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.46.3/com.google.api.client.json.webtoken.JsonWebToken.Payload)
- [1.45.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.45.3/com.google.api.client.json.webtoken.JsonWebToken.Payload)
- [1.44.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.44.2/com.google.api.client.json.webtoken.JsonWebToken.Payload)
- [1.43.2](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.43.2/com.google.api.client.json.webtoken.JsonWebToken.Payload)
- [1.42.3](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.42.3/com.google.api.client.json.webtoken.JsonWebToken.Payload)
- [1.41.8](https://docs.cloud.google.com/java/docs/reference/google-http-client/1.41.8/com.google.api.client.json.webtoken.JsonWebToken.Payload)

    public static class JsonWebToken.Payload extends GenericJson

Payload as specified in [Reserved
Claim Names](https://tools.ietf.org/html/rfc7519#section-4.1).

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [AbstractMap](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html) \> [GenericData](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData) \> [GenericJson](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson) \> JsonWebToken.Payload

## Inherited Members

[GenericJson.clone()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_clone__) [GenericJson.getFactory()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_getFactory__) [GenericJson.set(String,Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_set_java_lang_String_java_lang_Object_) [GenericJson.setFactory(JsonFactory)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_setFactory_com_google_api_client_json_JsonFactory_) [GenericJson.toPrettyString()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_toPrettyString__) [GenericJson.toString()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_toString__) [GenericData.entrySet()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_entrySet__) [GenericData.equals(Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_equals_java_lang_Object_) [GenericData.get(Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_get_java_lang_Object_) [GenericData.getClassInfo()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_getClassInfo__) [GenericData.getUnknownKeys()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_getUnknownKeys__) [GenericData.hashCode()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_hashCode__) [GenericData.put(String,Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_put_java_lang_String_java_lang_Object_) [GenericData.putAll(Map\<? extends String,?\>)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_putAll_java_util_Map___extends_java_lang_String____) [GenericData.remove(Object)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_remove_java_lang_Object_) [GenericData.setUnknownKeys(Map\<String,Object\>)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.util.GenericData#com_google_api_client_util_GenericData_setUnknownKeys_java_util_Map_java_lang_String_java_lang_Object__) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-) [AbstractMap.clear()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#clear--) [AbstractMap.containsKey(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsKey-java.lang.Object-) [AbstractMap.containsValue(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsValue-java.lang.Object-) [AbstractMap.isEmpty()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#isEmpty--) [AbstractMap.keySet()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#keySet--) [AbstractMap.put(K,V)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#put-K-V-) [AbstractMap.putAll(Map\<? extends K,? extends V\>)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#putAll-java.util.Map<? extends K-? extends V>-) [AbstractMap.size()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#size--) [AbstractMap.values()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#values--)

## Constructors

### Payload()

    public Payload()

## Methods

### clone()

    public JsonWebToken.Payload clone()

Makes a "deep" clone of the generic data, in which the clone is completely independent of the
original.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Payload` |   |

**Overrides** [GenericJson.clone()](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_clone__)

### getAudience()

    public final Object getAudience()

Returns the audience claim that identifies the audience that the JWT is intended for (should
either be a `String` or a `List<String>`) or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |   |

### getAudienceAsList()

    public final List<String> getAudienceAsList()

Returns the list of audience claim that identifies the audience that the JWT is intended for
or empty for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

### getExpirationTimeSeconds()

    public final Long getExpirationTimeSeconds()

Returns the expiration time (in seconds) claim that identifies the expiration time on or
after which the token MUST NOT be accepted for processing or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getIssuedAtTimeSeconds()

    public final Long getIssuedAtTimeSeconds()

Returns the issued at claim that identifies the time (in seconds) at which the JWT was issued
or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getIssuer()

    public final String getIssuer()

Returns the issuer claim that identifies the principal that issued the JWT or `null`
for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getJwtId()

    public final String getJwtId()

Returns the JWT ID claim that provides a unique identifier for the JWT or `null` for
none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getNotBeforeTimeSeconds()

    public final Long getNotBeforeTimeSeconds()

Returns the not before claim that identifies the time (in seconds) before which the token
MUST NOT be accepted for processing or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getSubject()

    public final String getSubject()

Returns the subject claim identifying the principal that is the subject of the JWT or `
null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getType()

    public final String getType()

Returns the type claim that is used to declare a type for the contents of this JWT Claims Set
or `null` for none.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### set(String fieldName, Object value)

    public JsonWebToken.Payload set(String fieldName, Object value)

Sets the given field value (may be `null`) for the given field name. Any existing value
for the field will be overwritten. It may be more slightly more efficient than #put(String, Object) because it avoids accessing the field's original value.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `fieldName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Payload` |   |

**Overrides** [GenericJson.set(String fieldName, Object value)](https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.GenericJson#com_google_api_client_json_GenericJson_set_java_lang_String_java_lang_Object_)

### setAudience(Object audience)

    public JsonWebToken.Payload setAudience(Object audience)

Sets the audience claim that identifies the audience that the JWT is intended for (should
either be a `String` or a `List<String>`) or `null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `audience` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Payload` |   |

### setExpirationTimeSeconds(Long expirationTimeSeconds)

    public JsonWebToken.Payload setExpirationTimeSeconds(Long expirationTimeSeconds)

Sets the expiration time claim that identifies the expiration time (in seconds) on or after
which the token MUST NOT be accepted for processing or `null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `expirationTimeSeconds` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Payload` |   |

### setIssuedAtTimeSeconds(Long issuedAtTimeSeconds)

    public JsonWebToken.Payload setIssuedAtTimeSeconds(Long issuedAtTimeSeconds)

Sets the issued at claim that identifies the time (in seconds) at which the JWT was issued or
`null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `issuedAtTimeSeconds` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Payload` |   |

### setIssuer(String issuer)

    public JsonWebToken.Payload setIssuer(String issuer)

Sets the issuer claim that identifies the principal that issued the JWT or `null` for
none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `issuer` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Payload` |   |

### setJwtId(String jwtId)

    public JsonWebToken.Payload setJwtId(String jwtId)

Sets the JWT ID claim that provides a unique identifier for the JWT or `null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `jwtId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Payload` |   |

### setNotBeforeTimeSeconds(Long notBeforeTimeSeconds)

    public JsonWebToken.Payload setNotBeforeTimeSeconds(Long notBeforeTimeSeconds)

Sets the not before claim that identifies the time (in seconds) before which the token MUST
NOT be accepted for processing or `null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `notBeforeTimeSeconds` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Payload` |   |

### setSubject(String subject)

    public JsonWebToken.Payload setSubject(String subject)

Sets the subject claim identifying the principal that is the subject of the JWT or `
null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `subject` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Payload` |   |

### setType(String type)

    public JsonWebToken.Payload setType(String type)

Sets the type claim that is used to declare a type for the contents of this JWT Claims Set or
`null` for none.

Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `type` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-http-client/latest/com.google.api.client.json.webtoken.JsonWebToken.Payload` |   |