properties map for additional,
non-standard properties.
For an extended response, an application can add to the
properties map. When using the Jackson library, the
properties map is expanded as top level JSON properties through the
org..
For an extended response, an application can also create a subclass with
additional properties. Subclasses can use the protected copy constructor to
re-create an existing ProblemDetail instance as the subclass, e.g.
from an @ControllerAdvice such as
org. or
org..
org.springframework.web.ErrorResponse , org.springframework.web.ErrorResponseException
| Modifier and Type | Field and Description |
|---|---|
| private static final URI | |
| private String | |
| private URI | |
| private Map | |
| private int | |
| private String | |
| private URI |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | ProblemDetail(ProblemDetail other)
Copy constructor that a subclass can use to re-create and extend a
|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. |
| public static ProblemDetail | |
| public static ProblemDetail | |
| public static ProblemDetail | forStatusAndDetail(HttpStatusCode status, String detail)
Create a |
| public String | |
| public URI | |
| public Map | getProperties()
Return a generic map of properties that are not known ahead of time,
possibly |
| public int | getStatus()
Return the status associated with the problem, provided either to the
constructor or configured via |
| public String | |
| public URI | |
| public int | |
| protected String | |
| public void | |
| public void | |
| public void | |
| public void | setProperty(String
the property name name, Object the property value, possibly value)null if the intent is
to include a property with its value set to "null"Set a "dynamic" property to be added to a generic |
| public void | |
| public void | |
| public void | |
| public void | |
| public String |
| BLANK_TYPE | back to summary |
|---|---|
| private static final URI BLANK_TYPE | |
| detail | back to summary |
|---|---|
| private String detail
| |
| instance | back to summary |
|---|---|
| private URI instance
| |
| properties | back to summary |
|---|---|
| private Map<String, Object> properties
| |
| status | back to summary |
|---|---|
| private int status | |
| title | back to summary |
|---|---|
| private String title
| |
| type | back to summary |
|---|---|
| private URI type | |
| ProblemDetail | back to summary |
|---|---|
| protected ProblemDetail(int rawStatusCode) Protected constructor for subclasses. To create a
| |
| ProblemDetail | back to summary |
|---|---|
| protected ProblemDetail(ProblemDetail other) Copy constructor that a subclass can use to re-create and extend a
| |
| ProblemDetail | back to summary |
|---|---|
| protected ProblemDetail() No-arg constructor, for deserialization. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| forStatus | back to summary |
|---|---|
| public static ProblemDetail forStatus(HttpStatusCode status) Create a | |
| forStatus | back to summary |
|---|---|
| public static ProblemDetail forStatus(int status) Create a | |
| forStatusAndDetail | back to summary |
|---|---|
| public static ProblemDetail forStatusAndDetail(HttpStatusCode status, String detail) Create a | |
| getDetail | back to summary |
|---|---|
| public String getDetail() Return the configured
| |
| getInstance | back to summary |
|---|---|
| public URI getInstance() Return the configured
| |
| getProperties | back to summary |
|---|---|
| public Map Return a generic map of properties that are not known ahead of time,
possibly When Jackson JSON is present on the classpath, the content of this map
is unwrapped and rendered as top level key-value pairs in the output JSON.
Otherwise, they are rendered as a
| |
| getStatus | back to summary |
|---|---|
| public int getStatus() Return the status associated with the problem, provided either to the
constructor or configured via | |
| getTitle | back to summary |
|---|---|
| public String getTitle() Return the configured
| |
| getType | back to summary |
|---|---|
| public URI getType() Return the configured | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| initToStringContent | back to summary |
|---|---|
| protected String initToStringContent() Return a String representation of the | |
| setDetail | back to summary |
|---|---|
| public void setDetail(String detail) Setter for the By default, this is not set.
| |
| setInstance | back to summary |
|---|---|
| public void setInstance(URI instance) Setter for the By default, when
| |
| setProperties | back to summary |
|---|---|
| public void setProperties(Map<String, Object> properties) Setter for the By default, this is not set. When Jackson JSON is present on the classpath, any properties set here
are rendered as top level key-value pairs in the output JSON. Otherwise,
they are rendered as a | |
| setProperty | back to summary |
|---|---|
| public void setProperty(String name, Object value) Set a "dynamic" property to be added to a generic When Jackson JSON is present on the classpath, any properties set here
are rendered as top level key-value pairs in the output JSON. Otherwise,
they are rendered as a
| |
| setStatus | back to summary |
|---|---|
| public void setStatus(HttpStatus httpStatus) Setter for the
| |
| setStatus | back to summary |
|---|---|
| public void setStatus(int status) Setter for the
| |
| setTitle | back to summary |
|---|---|
| public void setTitle(String title) Setter for the By default, if not explicitly set and the status is well-known, this
is sourced from the
| |
| setType | back to summary |
|---|---|
| public void setType(URI type) Setter for the By default, this is
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |