Interface ProblemRepresentationFactory
public interface ProblemRepresentationFactory
Interface providing a set of factory methods to create different type of error representations,
based on the Problem Details for HTTP APIs specification.
- Since:
- 5.4.0
-
Method Summary
Modifier and TypeMethodDescriptioninvalidInput(Message title, Consumer<? super ProblemInvalidInputConfigurator> builder) Creates a problem representation for an invalid input error.default RepresentationCreates a problem representation with just a type.of(String type, Consumer<? super ProblemConfigurator> builder) Creates a problem representation with a type and optional user messages.default RepresentationCreates a problem representation with a type and a title.of(String type, Message title, Consumer<? super ProblemConfigurator> builder) Creates a problem representation with a type and a title.default Representationof(ProblemDetails problemDetails) Creates a problem representation from aProblemDetailsobject.of(ProblemDetails problemDetails, Consumer<? super ProblemConfigurator> builder) Creates a problem representation from aProblemDetailsobject.
-
Method Details
-
of
Creates a problem representation from aProblemDetailsobject.- Parameters:
problemDetails- the problem details object.builder- builder allowing the addition of extra information to the problem representation.- Returns:
- the problem representation.
-
of
Creates a problem representation from aProblemDetailsobject.- Parameters:
problemDetails- the problem details object.- Returns:
- the problem representation.
-
of
Creates a problem representation with a type and optional user messages.- Parameters:
type- the problem type.builder- builder allowing the addition of extra information to the problem representation.- Returns:
- the problem representation.
-
of
Creates a problem representation with just a type.- Parameters:
type- the problem type.- Returns:
- the problem representation.
-
of
Creates a problem representation with a type and a title.- Parameters:
type- the problem type.title- the problem title.builder- builder allowing the addition of extra information to the problem representation.- Returns:
- the problem representation.
-
of
Creates a problem representation with a type and a title.- Parameters:
type- the problem type.title- the problem title.- Returns:
- the problem representation.
-
invalidInput
Representation invalidInput(Message title, Consumer<? super ProblemInvalidInputConfigurator> builder) Creates a problem representation for an invalid input error.- Parameters:
title- the problem title.builder- builder allowing the addition of extra information to the problem representation.- Returns:
- the problem representation.
-