Class DirectorErrorResponseBuilder

java.lang.Object
com.creativityfactory.swiftserver.error.DirectorErrorResponseBuilder

public class DirectorErrorResponseBuilder extends Object
This class is responsible for constructing an ErrorResponse object using the builder pattern and setting default values for the error field based on the given status code.
  • Constructor Details

    • DirectorErrorResponseBuilder

      public DirectorErrorResponseBuilder(ErrorMessageBuilder messageBuilder)
      Creates a new instance of DirectorErrorResponseBuilder with a given ErrorMessageBuilder.
      Parameters:
      messageBuilder - the implementation of ErrorMessageBuilder to use
  • Method Details

    • make

      public void make(int code, String path, String message)
      Builds an ErrorResponse object with the given parameters and default values for the error field based on the given status code.
      Parameters:
      code - the HTTP status code
      path - the request path
      message - the error message