Class UserFacingError


  • public final class UserFacingError
    extends Object
    Error object used by layers that have access to localized content, and propagate that to user.
    • Constructor Detail

      • UserFacingError

        public UserFacingError()
    • Method Detail

      • code

        public String code()
        Get the code property: Unique code for this error.
        Returns:
        the code value.
      • withCode

        public UserFacingError withCode​(String code)
        Set the code property: Unique code for this error.
        Parameters:
        code - the code value to set.
        Returns:
        the UserFacingError object itself.
      • details

        public List<UserFacingError> details()
        Get the details property: Additional related Errors.
        Returns:
        the details value.
      • withDetails

        public UserFacingError withDetails​(List<UserFacingError> details)
        Set the details property: Additional related Errors.
        Parameters:
        details - the details value to set.
        Returns:
        the UserFacingError object itself.
      • innerError

        public InnerError innerError()
        Get the innerError property: InnerError Inner Error.
        Returns:
        the innerError value.
      • withInnerError

        public UserFacingError withInnerError​(InnerError innerError)
        Set the innerError property: InnerError Inner Error.
        Parameters:
        innerError - the innerError value to set.
        Returns:
        the UserFacingError object itself.
      • isRetryable

        public Boolean isRetryable()
        Get the isRetryable property: Whether the operation will be retryable or not.
        Returns:
        the isRetryable value.
      • withIsRetryable

        public UserFacingError withIsRetryable​(Boolean isRetryable)
        Set the isRetryable property: Whether the operation will be retryable or not.
        Parameters:
        isRetryable - the isRetryable value to set.
        Returns:
        the UserFacingError object itself.
      • isUserError

        public Boolean isUserError()
        Get the isUserError property: Whether the operation is due to a user error or service error.
        Returns:
        the isUserError value.
      • withIsUserError

        public UserFacingError withIsUserError​(Boolean isUserError)
        Set the isUserError property: Whether the operation is due to a user error or service error.
        Parameters:
        isUserError - the isUserError value to set.
        Returns:
        the UserFacingError object itself.
      • properties

        public Map<String,​String> properties()
        Get the properties property: Any key value pairs that can be injected inside error object.
        Returns:
        the properties value.
      • withProperties

        public UserFacingError withProperties​(Map<String,​String> properties)
        Set the properties property: Any key value pairs that can be injected inside error object.
        Parameters:
        properties - the properties value to set.
        Returns:
        the UserFacingError object itself.
      • message

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

        public UserFacingError withMessage​(String message)
        Set the message property: The message property.
        Parameters:
        message - the message value to set.
        Returns:
        the UserFacingError object itself.
      • recommendedAction

        public List<String> recommendedAction()
        Get the recommendedAction property: RecommendedAction � localized.
        Returns:
        the recommendedAction value.
      • withRecommendedAction

        public UserFacingError withRecommendedAction​(List<String> recommendedAction)
        Set the recommendedAction property: RecommendedAction � localized.
        Parameters:
        recommendedAction - the recommendedAction value to set.
        Returns:
        the UserFacingError object itself.
      • target

        public String target()
        Get the target property: Target of the error.
        Returns:
        the target value.
      • withTarget

        public UserFacingError withTarget​(String target)
        Set the target property: Target of the error.
        Parameters:
        target - the target value to set.
        Returns:
        the UserFacingError object itself.
      • validate

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