Class Problem
java.lang.Object
org.springframework.hateoas.mediatype.problem.Problem
- Direct Known Subclasses:
Problem.ExtendedProblem
Encapsulation of an RFC-7807 Problem code. While it complies out-of-the-box, it may also be extended to
support domain-specific details.
- Author:
- Greg Turnquist, Oliver Drotbohm
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Problemcreate()Returns an emptyProbleminstance.static <T> Problem.ExtendedProblem<T>create(T payload) Returns anProblem.ExtendedProblemwith the given payload as additional properties.booleangetTitle()getType()inthashCode()static ProblemstatusOnly(HttpStatus status) toString()withDetail(String detail) Create a newProblemby copying its attributes and replacing the detail.withInstance(URI instance) Create a newProblemby copying its attributes and replacing the instance.withProperties(Consumer<Map<String, Object>> consumer) Returns anProblem.ExtendedProblemwith aMap<String,populated by the given consumer as payload.Object> withProperties(Map<String, Object> properties) Returns anProblem.ExtendedProblemwith the givenMapunwrapping as additional properties.<T> Problem.ExtendedProblem<T>withProperties(T payload) Creates a newProblem.ExtendedProblemwith the given payload as additional properties.withStatus(HttpStatus status) Create a newProblemby copying its attributes and replacing the status.Create a newProblemby copying its attributes and replacing the title.Create a newProblemby copying its attributes and replacing the type.
-
Constructor Details
-
Problem
-
Problem
protected Problem()
-
-
Method Details
-
create
Returns an emptyProbleminstance.- Returns:
- an empty
Probleminstance.
-
create
Returns anProblem.ExtendedProblemwith the given payload as additional properties.- Type Parameters:
T-- Parameters:
payload- must not be null.- Returns:
-
statusOnly
- Parameters:
status- must not be null.- Returns:
- See Also:
-
withType
Create a newProblemby copying its attributes and replacing the type.- Parameters:
type-- Returns:
-
withTitle
Create a newProblemby copying its attributes and replacing the title.- Parameters:
title-- Returns:
-
withStatus
Create a newProblemby copying its attributes and replacing the status.- Parameters:
status-- Returns:
-
withDetail
Create a newProblemby copying its attributes and replacing the detail.- Parameters:
detail-- Returns:
-
withInstance
Create a newProblemby copying its attributes and replacing the instance.- Parameters:
instance-- Returns:
-
withProperties
Creates a newProblem.ExtendedProblemwith the given payload as additional properties.- Type Parameters:
T-- Parameters:
payload- must not be null.- Returns:
-
withProperties
public Problem.ExtendedProblem<Map<String,Object>> withProperties(Consumer<Map<String, Object>> consumer) Returns anProblem.ExtendedProblemwith aMap<String,populated by the given consumer as payload.Object> - Parameters:
consumer- must not be null.- Returns:
-
withProperties
Returns anProblem.ExtendedProblemwith the givenMapunwrapping as additional properties.- Parameters:
properties- must not be null.- Returns:
-
getType
-
getTitle
-
getStatus
-
getDetail
-
getInstance
-
equals
-
hashCode
public int hashCode() -
toString
-