Class NotificationResult


  • public final class NotificationResult
    extends Object
    convenience class to capture the result of a notification.
    • Field Detail

      • indicatesSuccess

        public final boolean indicatesSuccess
        true if and only if the notification was successful.
      • message

        public final String message
        the error message in case the notification was not successful or null, otherwise.
    • Constructor Detail

      • NotificationResult

        protected NotificationResult​(boolean initSuccess,
                                     String initMessage)
        default constructor
        Parameters:
        initSuccess - success flag
        initMessage - message in case notification was not successful
    • Method Detail

      • newSuccess

        public static NotificationResult newSuccess()
        returns a new NotificationResult instance indicating a successful notification.
        Returns:
        a new NotificationResult instance indicating a successful notification
      • newFailure

        public static NotificationResult newFailure​(String message)
        returns a new NotificationResult instance indicating a failed notification.
        Parameters:
        message - the message indicating why the notification failed
        Returns:
        a new NotificationResult instance indicating a successful notification