Class Error


  • public final class Error
    extends Object
    The error code compose of code and message.
    • Constructor Detail

      • Error

        public Error()
    • Method Detail

      • code

        public String code()
        Get the code property: The code of error.
        Returns:
        the code value.
      • withCode

        public Error withCode​(String code)
        Set the code property: The code of error.
        Parameters:
        code - the code value to set.
        Returns:
        the Error object itself.
      • message

        public String message()
        Get the message property: The message of error.
        Returns:
        the message value.
      • withMessage

        public Error withMessage​(String message)
        Set the message property: The message of error.
        Parameters:
        message - the message value to set.
        Returns:
        the Error object itself.
      • validate

        public void validate()
        Validates the instance.
        Throws:
        IllegalArgumentException - thrown if the instance is not valid.