Class NotificationSeverity

java.lang.Object
com.nomagic.magicdraw.ui.notification.NotificationSeverity
All Implemented Interfaces:
Serializable

@OpenApi public class NotificationSeverity extends Object implements Serializable
Class representing notification severity. Severity consists of two parts: unique id and human readable string.
See Also:
  • Field Details

  • Constructor Details

    • NotificationSeverity

      public NotificationSeverity()
    • NotificationSeverity

      public NotificationSeverity(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(String id, String text)
      Constructs notification severity with specified id and human readable text.
      Parameters:
      id - severity id
      text - severity text
  • Method Details

    • getSeverityId

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

      @OpenApi public 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 String createCustomSeverityId(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(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object