Class NotificationSeverity

  • All Implemented Interfaces:
    java.io.Serializable

    @OpenApi
    public class NotificationSeverity
    extends java.lang.Object
    implements java.io.Serializable
    Class representing notification severity. Severity consists of two parts: unique id and human readable string.
    See Also:
    Serialized Form
    • Constructor Detail

      • NotificationSeverity

        public NotificationSeverity()
      • NotificationSeverity

        public NotificationSeverity​(java.lang.String id)
        Constructs notification severity with specified id. This id value is also used as human readable text for severity.
        Parameters:
        id - notification severity id and text
      • NotificationSeverity

        public NotificationSeverity​(java.lang.String id,
                                    java.lang.String text)
        Constructs notification severity with specified id and human readable text.
        Parameters:
        id - severity id
        text - severity text
    • Method Detail

      • getSeverityId

        @OpenApi
        public java.lang.String getSeverityId()
        Returns severity id.
        Returns:
        severity id
      • getText

        @OpenApi
        public java.lang.String getText()
        Returns severity human readable text.
        Returns:
        severity human readable text
      • isInfo

        public boolean isInfo()
        Helper method returns true if current severity is info type severity.
        Returns:
        true if current severity is info type severity
      • isWarning

        public boolean isWarning()
        Helper method returns true if current severity is warning type severity.
        Returns:
        true if current severity is warning type severity
      • isError

        public boolean isError()
        Helper method returns true if current severity is error type severity.
        Returns:
        true if current severity is error type severity
      • createCustomSeverityId

        public static java.lang.String createCustomSeverityId​(java.lang.String newId,
                                                              NotificationSeverity.Type type)
        Helper method used to generate new type severity. It ensures that new severity type will be "derived" from one of existing types (INFO, WARNING, ERROR). This is achieved by prefixing new id with one of those types.
        Parameters:
        newId - new severity id's postfix
        type - new severity id's prefix
        Returns:
        newly created severity id.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object