Class NotificationSeverity
java.lang.Object
com.nomagic.magicdraw.ui.notification.NotificationSeverity
- All Implemented Interfaces:
Serializable
Class representing notification severity. Severity consists of two parts: unique id and human
readable string.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NotificationSeverity
static final NotificationSeverity
static final NotificationSeverity
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs notification severity with specified id.NotificationSeverity
(String id, String text) Constructs notification severity with specified id and human readable text. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
createCustomSeverityId
(String newId, NotificationSeverity.Type type) Helper method used to generate new type severity.boolean
Returns severity id.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
Helper method returns true if current severity is warning type severity.
-
Field Details
-
INFO
-
WARNING
-
ERROR
-
-
Constructor Details
-
NotificationSeverity
public NotificationSeverity() -
NotificationSeverity
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
Constructs notification severity with specified id and human readable text.- Parameters:
id
- severity idtext
- severity text
-
-
Method Details
-
getSeverityId
Returns severity id.- Returns:
- severity id
-
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
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
-
hashCode
public int hashCode()
-