- java.lang.Object
-
- org.shredzone.acme4j.Problem
-
- All Implemented Interfaces:
Serializable
public class Problem extends Object implements Serializable
A JSON problem. It contains further, machine- and human-readable details about the reason of an error or failure.- See Also:
- RFC 7807, Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JSON
asJSON()
Returns the problem asJSON
object, to access other, non-standard fields.Optional<String>
getDetail()
Returns a detailed and specific human-readable explanation of the problem.Optional<Identifier>
getIdentifier()
Returns theIdentifier
this problem relates to.Optional<URI>
getInstance()
Returns a URI that identifies the specific occurence of the problem.List<Problem>
getSubProblems()
Returns a list of sub-problems.Optional<String>
getTitle()
Returns a short, human-readable summary of the problem.URI
getType()
Returns the problem type.String
toString()
Returns a human-readable description of the problem, that is as specific as possible.
-
-
-
Method Detail
-
getTitle
public Optional<String> getTitle()
Returns a short, human-readable summary of the problem. The text may be localized if supported by the server. Empty if the server did not provide a title.- See Also:
toString()
-
getDetail
public Optional<String> getDetail()
Returns a detailed and specific human-readable explanation of the problem. The text may be localized if supported by the server.- See Also:
toString()
-
getInstance
public Optional<URI> getInstance()
Returns a URI that identifies the specific occurence of the problem. It is always an absolute URI.
-
getIdentifier
public Optional<Identifier> getIdentifier()
Returns theIdentifier
this problem relates to.- Since:
- 2.3
-
getSubProblems
public List<Problem> getSubProblems()
Returns a list of sub-problems.
-
asJSON
public JSON asJSON()
Returns the problem asJSON
object, to access other, non-standard fields.- Returns:
- Problem as
JSON
object
-
toString
public String toString()
Returns a human-readable description of the problem, that is as specific as possible. The description may be localized if supported by the server.If
getSubProblems()
exist, they will be appended.Technically, it returns
getDetail()
. If not set,getTitle()
is returned instead. As a last resort,getType()
is returned.
-
-