Class NotificationSeverity
- java.lang.Object
-
- com.nomagic.magicdraw.ui.notification.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NotificationSeverity.Type
Severity type
-
Field Summary
Fields Modifier and Type Field Description static NotificationSeverity
ERROR
static NotificationSeverity
INFO
private static long
serialVersionUID
private java.lang.String
severityId
private java.lang.String
text
static NotificationSeverity
WARNING
-
Constructor Summary
Constructors Constructor Description NotificationSeverity()
NotificationSeverity(java.lang.String id)
Constructs notification severity with specified id.NotificationSeverity(java.lang.String id, java.lang.String text)
Constructs notification severity with specified id and human readable text.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
createCustomSeverityId(java.lang.String newId, NotificationSeverity.Type type)
Helper method used to generate new type severity.boolean
equals(java.lang.Object o)
java.lang.String
getSeverityId()
Returns severity id.java.lang.String
getText()
Returns severity human readable text.int
hashCode()
boolean
isError()
Helper method returns true if current severity is error type severity.boolean
isInfo()
Helper method returns true if current severity is info type severity.boolean
isWarning()
Helper method returns true if current severity is warning type severity.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
INFO
@OpenApi public static final NotificationSeverity INFO
-
WARNING
@OpenApi public static final NotificationSeverity WARNING
-
ERROR
@OpenApi public static final NotificationSeverity ERROR
-
severityId
private java.lang.String severityId
-
text
private java.lang.String text
-
-
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 idtext
- 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 postfixtype
- new severity id's prefix- Returns:
- newly created severity id.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-