Interface RequiredFieldError

All Superinterfaces:
ErrorObject

public interface RequiredFieldError extends ErrorObject

Returned when a value is not defined for a required field.


Example to create an instance using the builder pattern

     RequiredFieldError requiredFieldError = RequiredFieldError.builder()
             .message("{message}")
             .field("{field}")
             .build()
 
  • Field Details

  • Method Details

    • getCode

      @NotNull @NotNull String getCode()
      Description copied from interface: ErrorObject

      Error identifier.

      Specified by:
      getCode in interface ErrorObject
      Returns:
      code
    • getMessage

      @NotNull @NotNull String getMessage()

      "A value is required for field $field."

      Specified by:
      getMessage in interface ErrorObject
      Returns:
      message
    • getField

      @NotNull @NotNull String getField()

      Name of the field missing the value.

      Returns:
      field
    • setMessage

      void setMessage(String message)

      "A value is required for field $field."

      Specified by:
      setMessage in interface ErrorObject
      Parameters:
      message - value to be set
    • setField

      void setField(String field)

      Name of the field missing the value.

      Parameters:
      field - value to be set
    • of

      static RequiredFieldError of()
      factory method
      Returns:
      instance of RequiredFieldError
    • of

      static RequiredFieldError of(RequiredFieldError template)
      factory method to create a shallow copy RequiredFieldError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of RequiredFieldError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static RequiredFieldErrorBuilder builder()
      builder factory method for RequiredFieldError
      Returns:
      builder
    • builder

      static RequiredFieldErrorBuilder builder(RequiredFieldError template)
      create builder for RequiredFieldError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withRequiredFieldError

      default <T> T withRequiredFieldError(Function<RequiredFieldError,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<RequiredFieldError> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference