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.SerializableClass 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 classNotificationSeverity.TypeSeverity type
-
Field Summary
Fields Modifier and Type Field Description static NotificationSeverityERRORstatic NotificationSeverityINFOprivate static longserialVersionUIDprivate java.lang.StringseverityIdprivate java.lang.Stringtextstatic NotificationSeverityWARNING
-
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.StringcreateCustomSeverityId(java.lang.String newId, NotificationSeverity.Type type)Helper method used to generate new type severity.booleanequals(java.lang.Object o)java.lang.StringgetSeverityId()Returns severity id.java.lang.StringgetText()Returns severity human readable text.inthashCode()booleanisError()Helper method returns true if current severity is error type severity.booleanisInfo()Helper method returns true if current severity is info type severity.booleanisWarning()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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-