Class AuthzDetailsElement
- java.lang.Object
-
- com.authlete.common.dto.AuthzDetailsElement
-
- All Implemented Interfaces:
Serializable
public class AuthzDetailsElement extends Object implements Serializable
A class that represents an element inauthorization_detailswhich is defined in "OAuth 2.0 Rich Authorization Requests".- Since:
- 2.56
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AuthzDetailsElement()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AuthzDetailsElementfromJson(String json)Build anAuthzDetailsElementinstance from a JSON string.String[]getActions()Get the actions.String[]getDataTypes()Get the data types.StringgetIdentifier()Get the identifier of a specific resource.String[]getLocations()Get the resources and/or resource servers.StringgetOtherFields()Get the other fields (than the pre-defined ones such astypeandlocations) as a string in the JSON format.Map<?,?>getOtherFieldsAsMap()String[]getPrivileges()Get the types or levels of privilege.StringgetType()Get the type of this element.AuthzDetailsElementsetActions(String[] actions)Set the actions.AuthzDetailsElementsetDataTypes(String[] dataTypes)Set the data types.AuthzDetailsElementsetIdentifier(String identifier)Set the identifier of a specific resource.AuthzDetailsElementsetLocations(String[] locations)Set the resources and/or resource servers.AuthzDetailsElementsetOtherFields(String otherFields)Set the other fields (than the pre-defined ones such astypeandlocations) as a string in the JSON format.AuthzDetailsElementsetOtherFieldsFromMap(Map<?,?> otherFields)AuthzDetailsElementsetPrivileges(String[] privileges)Set the types or levels of privilege.AuthzDetailsElementsetType(String type)Set the type of this element.StringtoJson()Convert this instance into a JSON string.
-
-
-
Method Detail
-
getType
public String getType()
Get the type of this element.From "OAuth 2.0 Rich Authorization Requests":
"The type of authorization data as a string. This field MAY define which other elements are allowed in the request. This element is REQUIRED."
- Returns:
- The type of this element.
-
setType
public AuthzDetailsElement setType(String type)
Set the type of this element.From "OAuth 2.0 Rich Authorization Requests":
"The type of authorization data as a string. This field MAY define which other elements are allowed in the request. This element is REQUIRED."
- Parameters:
type- The type of this element.- Returns:
thisobject.
-
getLocations
public String[] getLocations()
Get the resources and/or resource servers.From "OAuth 2.0 Rich Authorization Requests":
"An array of strings representing the location of the resource or resource server. These strings are typically URIs identifying the location of the RS."
- Returns:
- The resources and/or resource servers.
-
setLocations
public AuthzDetailsElement setLocations(String[] locations)
Set the resources and/or resource servers.From "OAuth 2.0 Rich Authorization Requests":
"An array of strings representing the location of the resource or resource server. These strings are typically URIs identifying the location of the RS."
- Parameters:
locations- The resources and/or resource servers.- Returns:
thisobject.
-
getActions
public String[] getActions()
Get the actions.From "OAuth 2.0 Rich Authorization Requests":
"An array of strings representing the kinds of actions to be taken at the resource."
- Returns:
- The actions.
-
setActions
public AuthzDetailsElement setActions(String[] actions)
Set the actions.From "OAuth 2.0 Rich Authorization Requests":
"An array of strings representing the kinds of actions to be taken at the resource."
- Parameters:
actions- The actions.- Returns:
thisobject.
-
getDataTypes
public String[] getDataTypes()
Get the data types.From "OAuth 2.0 Rich Authorization Requests":
"An array of strings representing the kinds of data being requested from the resource."
- Returns:
- The data types.
- Since:
- 2.85
-
setDataTypes
public AuthzDetailsElement setDataTypes(String[] dataTypes)
Set the data types.From "OAuth 2.0 Rich Authorization Requests":
"An array of strings representing the kinds of data being requested from the resource."
- Parameters:
dataTypes- The data types.- Returns:
thisobject.- Since:
- 2.85
-
getIdentifier
public String getIdentifier()
Get the identifier of a specific resource.From "OAuth 2.0 Rich Authorization Requests":
"A string identifier indicating a specific resource available at the API."
- Returns:
- The identifier of a specific resource.
-
setIdentifier
public AuthzDetailsElement setIdentifier(String identifier)
Set the identifier of a specific resource.From "OAuth 2.0 Rich Authorization Requests":
"A string identifier indicating a specific resource available at the API."
- Parameters:
identifier- The identifier of a specific resource.- Returns:
thisobject.
-
getPrivileges
public String[] getPrivileges()
Get the types or levels of privilege.From "OAuth 2.0 Rich Authorization Requests":
"An array of strings representing the types or levels of privilege being requested at the resource."
- Returns:
- Types or levels of privilege.
- Since:
- 2.91
-
setPrivileges
public AuthzDetailsElement setPrivileges(String[] privileges)
Set the types or levels of privilege.From "OAuth 2.0 Rich Authorization Requests":
"An array of strings representing the types or levels of privilege being requested at the resource."
- Parameters:
privileges- Types or levels of privilege.- Returns:
thisobject.- Since:
- 2.91
-
getOtherFields
public String getOtherFields()
Get the other fields (than the pre-defined ones such astypeandlocations) as a string in the JSON format.The content varies depending on the
typefield.- Returns:
- Other fields in the JSON format. This may be
null. - See Also:
getOtherFieldsAsMap()
-
setOtherFields
public AuthzDetailsElement setOtherFields(String otherFields)
Set the other fields (than the pre-defined ones such astypeandlocations) as a string in the JSON format.The content varies depending on the
typefield.- Parameters:
otherFields- Other fields in the JSON format.- Returns:
thisobject.
-
getOtherFieldsAsMap
public Map<?,?> getOtherFieldsAsMap()
Get the other fields (thantype,locations,actionsandidentifier) as aMapobject.The content varies depending on the
typefield.- Returns:
- Other fields as a
Mapobject. This may benull. - See Also:
getOtherFields()
-
setOtherFieldsFromMap
public AuthzDetailsElement setOtherFieldsFromMap(Map<?,?> otherFields)
Set the other fields (thantype,locations,actionsandidentifier) using aMapobject. The internal value is stored as a string serialization of theMapobject.The content varies depending on the
typefield.- Parameters:
otherFields- AMapinstance holding other fields.- Returns:
thisobject.- Since:
- 2.99
- See Also:
getOtherFieldsAsMap()
-
toJson
public String toJson()
Convert this instance into a JSON string."Other fields" (the string returned from
getOtherFields()are expanded into the output JSON.- Returns:
- A JSON string that represents this instance.
- Since:
- 2.57
-
fromJson
public static AuthzDetailsElement fromJson(String json)
Build anAuthzDetailsElementinstance from a JSON string.The following is an example of input JSON.
{ "type" : "my_type", "locations" : ["loc0", "loc1"], "actions" : ["act0", "act1"], "identifier": "my_id", "prop0" : "a", "prop1" : ["b", "c"], "prop2" : { "sub0": "d", "sub1": ["e", "f"] } }- Parameters:
json- A JSON string.- Returns:
- An
AuthzDetailsElementinstance built from the input JSON. - Since:
- 2.57
-
-