Package com.bfo.box
Class C2PAStatus
java.lang.Object
com.bfo.box.C2PAStatus
A representation of a C2PA
status code,
with a message and an optional URL describing its origin
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionC2PAStatus
(boolean success, String code, String message, String url, Throwable throwable) Create a new status based on a custom codeC2PAStatus
(C2PAStatus.Code code, String message, String url, Throwable throwable) Create a new status based on the specified standard code -
Method Summary
Modifier and TypeMethodDescriptiongetCode()
Return the code stringReturn the message if specified, or nullReturn the referenced C2PAStatus if specified, or nullReturn the Code enum, if this is a standard code, or null otherwiseReturn the Throwable if specified, or nullgetURL()
Return the URL if specified, or nullboolean
isError()
Return true if this is an error statusboolean
isOK()
Return true if this is not an error statustoJson()
Return a representation of this object as JsontoString()
-
Constructor Details
-
C2PAStatus
Create a new status based on the specified standard code- Parameters:
code
- the codemessage
- the message, or null to use the standard one for that codeurl
- the url of the object that the status relates to, or nullthrowable
- an optional Throwable relating to the status
-
C2PAStatus
Create a new status based on a custom code- Parameters:
success
- true if this status isok
, false if it's an errorcode
- the code (required)message
- the message (required)url
- the url of the object that the status relates to, or nullthrowable
- an optional Throwable relating to the status
-
-
Method Details
-
toString
-
isError
public boolean isError()Return true if this is an error status- Returns:
- true if this is an error status
-
isOK
public boolean isOK()Return true if this is not an error status- Returns:
- true if this is not an error status
-
getCode
Return the code string- Returns:
- the code string
-
getStandardCode
Return the Code enum, if this is a standard code, or null otherwise- Returns:
- the code
-
getMessage
Return the message if specified, or null- Returns:
- the message
-
getURL
Return the URL if specified, or null- Returns:
- the url
-
getThrowable
Return the Throwable if specified, or null- Returns:
- the throwable
-
getReferenced
Return the referenced C2PAStatus if specified, or null- Returns:
- the referenced status
-
toJson
Return a representation of this object as Json- Returns:
- the json
-