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 inherited from interface com.jalios.jcms.alert.AlertConstants
ALERT_META_INFO_ATTRIBUTE, 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 intcompareTo(AlertRule other)booleancontainsAlertChannel(AlertChannel alertChannel)Returns true if this AlertRule contains the given alertChannel.booleanequals(java.lang.Object obj)static AlertRulefromJSON(java.lang.String json)java.lang.String[]getAlertChannels()java.util.Set<AlertChannel>getAlertChannelSet()java.lang.StringgetAlertFullName()Returns the full name (i.e.java.lang.StringgetAlertLabel(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.StringgetDomain()Alert.LevelgetLevel()java.lang.StringgetLevelKey()java.lang.StringgetName()booleanisEmpty()Returns true if this AlertRule is empty (i.e.booleanmatches(Alert alert)Returns true if the given alert matches this rule.booleannotEmpty()Returns true if this AlertRule is not empty (i.e.voidsetAlertChannels(java.lang.String[] alertChannels)voidsetAlertChannelSet(java.util.Set<AlertChannel> alertChannelSet)voidsetDomain(java.lang.String domain)voidsetLevel(Alert.Level level)voidsetLevelKey(java.lang.String key)voidsetName(java.lang.String name)java.lang.StringtoJSON()static java.lang.StringtoJSON(java.util.Set<AlertRule> ruleSet)java.lang.StringtoString()
-
-
-
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:
compareToin interfacejava.lang.Comparable<AlertRule>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin 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:
toStringin 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)
-
-