Class Attachment
java.lang.Object
com.nimbusds.openid.connect.sdk.assurance.evidences.attachment.Attachment
- Direct Known Subclasses:
EmbeddedAttachment,ExternalAttachment
Identity evidence attachment.
Related specifications:
- OpenID Connect for Identity Assurance 1.0, section 5.1.2.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAttachment(AttachmentType type, String description) Creates a new attachment with the specified description. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the description.getType()Returns the type of this attachment.inthashCode()static Attachmentparse(net.minidev.json.JSONObject jsonObject) Parses an identity evidence attachment from the specified JSON object.static List<Attachment>parseList(net.minidev.json.JSONArray jsonArray) Parses a list of identity evidence attachments from the specified JSON array.Casts this attachment to an embedded attachment.Casts this attachment to an external attachment.net.minidev.json.JSONObjectReturns a JSON object representation of this attachment.
-
Constructor Details
-
Attachment
Creates a new attachment with the specified description.- Parameters:
type- The type. Must not benull.description- The description,nullif not specified.
-
-
Method Details
-
getType
Returns the type of this attachment.- Returns:
- The type.
-
getDescriptionString
Returns the description.- Returns:
- The description string.
-
toJSONObject
Returns a JSON object representation of this attachment.- Returns:
- The JSON object.
-
equals
-
hashCode
-
toEmbeddedAttachment
Casts this attachment to an embedded attachment.- Returns:
- The embedded attachment.
- Throws:
ClassCastException- If the cast failed.
-
toExternalAttachment
Casts this attachment to an external attachment.- Returns:
- The external attachment.
- Throws:
ClassCastException- If the cast failed.
-
parse
Parses an identity evidence attachment from the specified JSON object.- Parameters:
jsonObject- The JSON object. Must not benull.- Returns:
- The identity evidence attachment.
- Throws:
ParseException- If parsing failed.
-
parseList
public static List<Attachment> parseList(net.minidev.json.JSONArray jsonArray) throws ParseException Parses a list of identity evidence attachments from the specified JSON array.- Parameters:
jsonArray- The JSON array,nullif not specified.- Returns:
- The list of identity evidence attachments,
nullif not specified. - Throws:
ParseException- If parsing failed.
-