@Immutable public final class Actor extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<Actor>, net.minidev.json.JSONAware
Constructor and Description |
---|
Actor(Subject subject)
Creates a new actor.
|
Actor(Subject subject,
Issuer issuer,
Actor parent)
Creates a new actor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Actor other) |
boolean |
equals(java.lang.Object o) |
Issuer |
getIssuer()
Returns the optional issuer for the subject.
|
Actor |
getParent()
Returns the optional parent for this actor.
|
Subject |
getSubject()
Returns the subject.
|
int |
hashCode() |
static Actor |
parse(net.minidev.json.JSONObject jsonObject)
Parses an actor from the specified JSON object representation.
|
static Actor |
parseTopLevel(net.minidev.json.JSONObject jsonObject)
Parses an actor from the specified top-level JSON object contains
an optional actor JSON representation.
|
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of this actor.
|
java.lang.String |
toJSONString() |
public Actor(Subject subject)
subject
- The subject. Must not be null
.public Subject getSubject()
public Issuer getIssuer()
null
if not specified.public Actor getParent()
null
if none.public net.minidev.json.JSONObject toJSONObject()
Simple example:
{ "sub" : "[email protected]" }
With nesting:
{ "sub" : "consumer.example.com-web-application", "iss" : "https://issuer.example.net", "act" : { "sub":"[email protected]" } }
public int compareTo(Actor other)
compareTo
in interface java.lang.Comparable<Actor>
public java.lang.String toJSONString()
toJSONString
in interface net.minidev.json.JSONAware
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static Actor parse(net.minidev.json.JSONObject jsonObject) throws ParseException
Simple example:
{ "sub" : "[email protected]" }
With nesting:
{ "sub" : "consumer.example.com-web-application", "iss" : "https://issuer.example.net", "act" : { "sub":"[email protected]" } }
jsonObject
- The JSON object. Must not be null
.ParseException
- If parsing failed.public static Actor parseTopLevel(net.minidev.json.JSONObject jsonObject) throws ParseException
Simple example:
{ "aud" : "https://consumer.example.com", "iss" : "https://issuer.example.com", "exp" : 1443904177, "nbf" : 1443904077, "sub" : "[email protected]", "act" : { "sub" : "[email protected]" } }
With nesting: { "aud" : "https://backend.example.com", "iss" : "https://issuer.example.com", "exp" : 1443904100, "nbf" : 1443904000, "sub" : "[email protected]", "act" : { "sub" : "consumer.example.com-web-application", "iss" : "https://issuer.example.net", "act" : { "sub":"[email protected]" } } }
jsonObject
- The top-level JSON object to parse. Must not be
null
.null
if not specified.ParseException
- If parsing failed.Copyright © 2016 Connect2id Ltd.. All Rights Reserved.