Package com.jalios.jcms.alert
Class AlertRule
- java.lang.Object
-
- com.jalios.jcms.alert.AlertRule
-
- All Implemented Interfaces:
AlertConstants
,java.lang.Comparable<AlertRule>
public class AlertRule extends java.lang.Object implements AlertConstants, java.lang.Comparable<AlertRule>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REVISION
-
Fields inherited from interface com.jalios.jcms.alert.AlertConstants
CTXT_DELETE_ALERT, HTML_MARKUP, MSG_PREFIX_PROP, NAME_PREFIX_PROP, NO_ALERT_FLAG, TEXT_MARKUP, WIKI_MARKUP
-
-
Constructor Summary
Constructors Constructor Description AlertRule()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AlertRule other)
boolean
containsAlertChannel(AlertChannel alertChannel)
Returns true if this AlertRule contains the given alertChannel.boolean
equals(java.lang.Object obj)
static AlertRule
fromJSON(java.lang.String json)
java.lang.String[]
getAlertChannels()
java.util.Set<AlertChannel>
getAlertChannelSet()
java.lang.String
getAlertFullName()
Returns the full name (i.e.java.lang.String
getAlertLabel(java.lang.String userLang)
Returns the label of the alert type of this AlertRule.static java.util.Set<AlertRule>
getAlertRuleSet(java.lang.String json)
java.lang.String
getDomain()
Alert.Level
getLevel()
java.lang.String
getLevelKey()
java.lang.String
getName()
boolean
isEmpty()
Returns true if this AlertRule is empty (i.e.boolean
matches(Alert alert)
Returns true if the given alert matches this rule.boolean
notEmpty()
Returns true if this AlertRule is not empty (i.e.void
setAlertChannels(java.lang.String[] alertChannels)
void
setAlertChannelSet(java.util.Set<AlertChannel> alertChannelSet)
void
setDomain(java.lang.String domain)
void
setLevel(Alert.Level level)
void
setLevelKey(java.lang.String key)
void
setName(java.lang.String name)
java.lang.String
toJSON()
static java.lang.String
toJSON(java.util.Set<AlertRule> ruleSet)
java.lang.String
toString()
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
-
Method Detail
-
matches
public boolean matches(Alert alert)
Returns true if the given alert matches this rule.- Parameters:
alert
- the alert- Returns:
- true if the given alert matches this rule.
- Since:
- jcms-8.0.0
-
compareTo
public int compareTo(AlertRule other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<AlertRule>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getLevel
public Alert.Level getLevel()
-
setLevel
public void setLevel(Alert.Level level)
-
getLevelKey
public java.lang.String getLevelKey()
-
setLevelKey
public void setLevelKey(java.lang.String key)
-
getDomain
public java.lang.String getDomain()
-
setDomain
public void setDomain(java.lang.String domain)
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
getAlertChannelSet
public java.util.Set<AlertChannel> getAlertChannelSet()
-
setAlertChannelSet
public void setAlertChannelSet(java.util.Set<AlertChannel> alertChannelSet)
-
getAlertChannels
public java.lang.String[] getAlertChannels()
-
setAlertChannels
public void setAlertChannels(java.lang.String[] alertChannels)
-
isEmpty
public boolean isEmpty()
Returns true if this AlertRule is empty (i.e. no level, no domain and no alert channel).- Returns:
- true if this AlertRule is empty (i.e. no level, no domain and no alert channel).
- Since:
- jcms-8.0.0
-
notEmpty
public boolean notEmpty()
Returns true if this AlertRule is not empty (i.e. a level, a domain or at least one alert channel).- Returns:
- true if this AlertRule is not empty (i.e. a level, a domain or at least one alert channel).
- Since:
- jcms-8.0.0
-
containsAlertChannel
public boolean containsAlertChannel(AlertChannel alertChannel)
Returns true if this AlertRule contains the given alertChannel.- Parameters:
alertChannel
- the alertChannel- Returns:
- true if this AlertRule contains the given alertChannel.
- Since:
- jcms-8.0.0
-
getAlertFullName
public java.lang.String getAlertFullName()
Returns the full name (i.e. domain + "." + name) of the alert type of this AlertRule.- Returns:
- the full name (i.e. domain + "." + name) of the alert type of this AlertRule.
- Since:
- jcms-8.0.0
-
getAlertLabel
public java.lang.String getAlertLabel(java.lang.String userLang)
Returns the label of the alert type of this AlertRule.- Parameters:
userLang
- the user language- Returns:
- the label of the alert type of this AlertRule.
- Since:
- jcms-8.0.0
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toJSON
public java.lang.String toJSON()
-
toJSON
public static java.lang.String toJSON(java.util.Set<AlertRule> ruleSet)
-
getAlertRuleSet
public static java.util.Set<AlertRule> getAlertRuleSet(java.lang.String json)
-
fromJSON
public static AlertRule fromJSON(java.lang.String json)
-
-