Package rocks.xmpp.extensions.amp.model
Class Rule
- java.lang.Object
-
- rocks.xmpp.extensions.amp.model.Rule
-
public final class Rule extends Object
The implementation of the<rule/>element, used both in thehttp://jabber.org/protocol/ampnamespace as well as in thehttp://jabber.org/protocol/amp#errorsnamespace.This class is immutable.
- See Also:
- XEP-0079: Advanced Message Processing, XML Schema
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRule.ActionThe action defines what occurs when a particular rule is triggered.static classRule.ConditionThe condition defines how or when a particular rule is triggered.static classRule.DeliveryModeThe possible values for theRule.Condition.DELIVERcondition.static classRule.MatchResourceThe possible values for theRule.Condition.MATCH_RESOURCEcondition.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Ruledeliver(Rule.Action action, Rule.DeliveryMode value)Creates the defined "deliver" rule.static RuleexpireAt(Rule.Action action, Instant instant)Creates the defined "expire-at" rule.Rule.ActiongetAction()The 'action' attribute defines the result for this rule.Rule.ConditiongetCondition()The 'condition' attribute defines the overall condition this rule applies to.StringgetValue()The 'value' attribute defines how the condition is matched.static RulematchResource(Rule.Action action, Rule.MatchResource value)Creates the defined "match-resource" rule.static Ruleof(Rule.Action action, Rule.Condition condition, String value)Creates a rule.
-
-
-
Method Detail
-
of
public static Rule of(Rule.Action action, Rule.Condition condition, String value)
Creates a rule.- Parameters:
action- The action.condition- The condition.value- The value. This depends on the condition.- Returns:
- The rule.
-
expireAt
public static Rule expireAt(Rule.Action action, Instant instant)
Creates the defined "expire-at" rule.- Parameters:
action- The action.instant- The expiration date.- Returns:
- The rule.
-
deliver
public static Rule deliver(Rule.Action action, Rule.DeliveryMode value)
Creates the defined "deliver" rule.- Parameters:
action- The action.value- The value.- Returns:
- The rule.
-
matchResource
public static Rule matchResource(Rule.Action action, Rule.MatchResource value)
Creates the defined "match-resource" rule.- Parameters:
action- The action.value- The value.- Returns:
- The rule.
-
getAction
public final Rule.Action getAction()
The 'action' attribute defines the result for this rule.- Returns:
- The action.
-
getCondition
public final Rule.Condition getCondition()
The 'condition' attribute defines the overall condition this rule applies to.- Returns:
- The condition.
-
getValue
public final String getValue()
The 'value' attribute defines how the condition is matched.- Returns:
- The value.
-
-