Class AlertRule

java.lang.Object
com.jalios.jcms.alert.AlertRule
All Implemented Interfaces:
AlertConstants, Comparable<AlertRule>

public class AlertRule extends Object implements AlertConstants, Comparable<AlertRule>
  • Constructor Details

    • AlertRule

      public AlertRule()
  • Method Details

    • 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 interface Comparable<AlertRule>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getLevel

      public Alert.Level getLevel()
    • setLevel

      public void setLevel(Alert.Level level)
    • getLevelKey

      public String getLevelKey()
    • setLevelKey

      public void setLevelKey(String key)
    • getDomain

      public String getDomain()
    • setDomain

      public void setDomain(String domain)
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getAlertChannelSet

      public Set<AlertChannel> getAlertChannelSet()
    • setAlertChannelSet

      public void setAlertChannelSet(Set<AlertChannel> alertChannelSet)
    • getAlertChannels

      public String[] getAlertChannels()
    • setAlertChannels

      public void setAlertChannels(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 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 String getAlertLabel(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 String toString()
      Overrides:
      toString in class Object
    • toJSON

      public String toJSON()
    • toJSON

      public static String toJSON(Set<AlertRule> ruleSet)
    • getAlertRuleSet

      public static Set<AlertRule> getAlertRuleSet(String json)
    • fromJSON

      public static AlertRule fromJSON(String json)