|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nimbusds.jose.Payload
@Immutable public class Payload
Payload with JSON object, string, byte array and Base64URL views. Represents the original object that was signed with JWS or encrypted with JWE. This class is immutable.
Non-initial views are created on demand to conserve resources.
UTF-8 is the character set for all string from / to byte array conversions.
Conversion relations:
JSONObject <=> String <=> Base64URL <=> byte[]
Nested Class Summary | |
---|---|
static class |
Payload.Origin
Enumeration of the original data types used to create a Payload . |
Constructor Summary | |
---|---|
Payload(Base64URL base64URL)
Creates a new payload from the specified Base64URL-encoded object. |
|
Payload(byte[] bytes)
Creates a new payload from the specified byte array. |
|
Payload(net.minidev.json.JSONObject json)
Creates a new payload from the specified JSON object. |
|
Payload(java.lang.String string)
Creates a new payload from the specified string. |
Method Summary | |
---|---|
Payload.Origin |
getOrigin()
Gets the original data type used to create this payload. |
Base64URL |
toBase64URL()
Returns a Base64URL view of this payload. |
byte[] |
toBytes()
Returns a byte array view of this payload. |
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object view of this payload. |
java.lang.String |
toString()
Returns a string view of this payload. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Payload(net.minidev.json.JSONObject json)
json
- The JSON object representing the payload. Must not be
null
.public Payload(java.lang.String string)
string
- The string representing the payload. Must not be
null
.public Payload(byte[] bytes)
bytes
- The byte array representing the payload. Must not be
null
.public Payload(Base64URL base64URL)
base64URL
- The Base64URL-encoded object representing the
payload. Must not be null
.Method Detail |
---|
public Payload.Origin getOrigin()
public net.minidev.json.JSONObject toJSONObject()
null
if the payload couldn't
be converted to a JSON object.public java.lang.String toString()
toString
in class java.lang.Object
public byte[] toBytes()
public Base64URL toBase64URL()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |