Package com.bfo.box

Class C2PAStatus

java.lang.Object
com.bfo.box.C2PAStatus

public class C2PAStatus extends Object
A representation of a C2PA status code, with a message and an optional URL describing its origin
  • Constructor Details

    • C2PAStatus

      public C2PAStatus(C2PAStatus.Code code, String message, String url, Throwable throwable)
      Create a new status based on the specified standard code
      Parameters:
      code - the code
      message - the message, or null to use the standard one for that code
      url - the url of the object that the status relates to, or null
      throwable - an optional Throwable relating to the status
    • C2PAStatus

      public C2PAStatus(boolean success, String code, String message, String url, Throwable throwable)
      Create a new status based on a custom code
      Parameters:
      success - true if this status is ok, false if it's an error
      code - the code (required)
      message - the message (required)
      url - the url of the object that the status relates to, or null
      throwable - an optional Throwable relating to the status
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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

      public String getCode()
      Return the code string
      Returns:
      the code string
    • getStandardCode

      public C2PAStatus.Code getStandardCode()
      Return the Code enum, if this is a standard code, or null otherwise
      Returns:
      the code
    • getMessage

      public String getMessage()
      Return the message if specified, or null
      Returns:
      the message
    • getURL

      public String getURL()
      Return the URL if specified, or null
      Returns:
      the url
    • getThrowable

      public Throwable getThrowable()
      Return the Throwable if specified, or null
      Returns:
      the throwable
    • getReferenced

      public C2PAStatus getReferenced()
      Return the referenced C2PAStatus if specified, or null
      Returns:
      the referenced status
    • toJson

      public Json toJson()
      Return a representation of this object as Json
      Returns:
      the json