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 Details

    • of

      Representation of(ProblemDetails problemDetails, Consumer<? super ProblemConfigurator> builder)
      Creates a problem representation from a ProblemDetails object.
      Parameters:
      problemDetails - the problem details object.
      builder - builder allowing the addition of extra information to the problem representation.
      Returns:
      the problem representation.
    • of

      default Representation of(ProblemDetails problemDetails)
      Creates a problem representation from a ProblemDetails object.
      Parameters:
      problemDetails - the problem details object.
      Returns:
      the problem representation.
    • of

      Representation of(String type, Consumer<? super ProblemConfigurator> builder)
      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

      default Representation of(String type)
      Creates a problem representation with just a type.
      Parameters:
      type - the problem type.
      Returns:
      the problem representation.
    • of

      Representation of(String type, Message title, Consumer<? super ProblemConfigurator> builder)
      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

      default Representation of(String type, Message title)
      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.