Class PersistentStatusMessage.Builder

    • Method Detail

      • validate

        protected Validator validate​(Validator problems)
        Description copied from class: EMessage.Builder
        Checks if message subject and message type are configured. If not, then text explaining this error is appended to problems.

        This method should be overridden by subclass message builders and called before doing its own validation. The first line in the subclass validate implementation should be super.validate(problems);.

        When overriding this method, be sure to add all discovered validation problems to the list. The validation method should consist of a series of individual if statements and not an if/else if chain. That way all problems are found and not just the first one.

        Please see Validator for a validation Builder settings example.

        Overrides:
        validate in class EMessage.Builder<PersistentStatusMessage,​PersistentStatusMessage.Builder>
        Parameters:
        problems - used to check field validity and collect discovered invalid fields.
        Returns:
        problems to allow for method chaining.
        See Also:
        Validator
      • hostName

        public PersistentStatusMessage.Builder hostName​(java.lang.String name)
        Sets host name to given value. This name does not need to be a network host name but any name meaningful to the application and those monitoring it.
        Parameters:
        name - host name.
        Returns:
        this Builder instance.
        Throws:
        java.lang.IllegalArgumentException - if name is either null or empty.
      • appName

        public PersistentStatusMessage.Builder appName​(java.lang.String name)
        Sets application name to given value.
        Parameters:
        name - application name.
        Returns:
        this Builder instance.
        Throws:
        java.lang.IllegalArgumentException - if name is either null or empty.
      • actionLevel

        public PersistentStatusMessage.Builder actionLevel​(ActionLevel level)
        Sets action level.
        Parameters:
        level - action level.
        Returns:
        this Builder instance.
        Throws:
        java.lang.NullPointerException - if level is null.
      • actionName

        public PersistentStatusMessage.Builder actionName​(java.lang.String name)
        Sets action name.
        Parameters:
        name - action name.
        Returns:
        this Builder instance.
        Throws:
        java.lang.IllegalArgumentException - if name is either null or an empty string.
      • actionMessage

        public PersistentStatusMessage.Builder actionMessage​(@Nullable
                                                             java.lang.String message)
        Sets action message.
        Parameters:
        message - action message. May be either null or an empty string.
        Returns:
        this Builder instance.