public final class Rule
extends java.lang.Object
The implementation of the <rule/>
element, used both in the http://jabber.org/protocol/amp
namespace as well as in the http://jabber.org/protocol/amp#errors
namespace.
This class is immutable.
Modifier and Type | Class and Description |
---|---|
static class |
Rule.Action
The action defines what occurs when a particular rule is triggered.
|
static class |
Rule.Condition
The condition defines how or when a particular rule is triggered.
|
static class |
Rule.DeliveryMode
The possible values for the
Rule.Condition.DELIVER condition. |
static class |
Rule.MatchResource
The possible values for the
Rule.Condition.MATCH_RESOURCE condition. |
Modifier and Type | Method and Description |
---|---|
static Rule |
deliver(Rule.Action action,
Rule.DeliveryMode value)
Creates the defined “deliver” rule.
|
static Rule |
expireAt(Rule.Action action,
java.time.Instant instant)
Creates the defined “expire-at” rule.
|
Rule.Action |
getAction()
The ‘action’ attribute defines the result for this rule.
|
Rule.Condition |
getCondition()
The ‘condition’ attribute defines the overall condition this rule applies to.
|
java.lang.String |
getValue()
The ‘value’ attribute defines how the condition is matched.
|
static Rule |
matchResource(Rule.Action action,
Rule.MatchResource value)
Creates the defined “match-resource” rule.
|
static Rule |
of(Rule.Action action,
Rule.Condition condition,
java.lang.String value)
Creates a rule.
|
public static Rule of(Rule.Action action, Rule.Condition condition, java.lang.String value)
Creates a rule.
action
- The action.condition
- The condition.value
- The value. This depends on the condition.public static Rule expireAt(Rule.Action action, java.time.Instant instant)
Creates the defined “expire-at” rule.
action
- The action.instant
- The expiration date.public static Rule deliver(Rule.Action action, Rule.DeliveryMode value)
Creates the defined “deliver” rule.
action
- The action.value
- The value.public static Rule matchResource(Rule.Action action, Rule.MatchResource value)
Creates the defined “match-resource” rule.
action
- The action.value
- The value.public final Rule.Action getAction()
The ‘action’ attribute defines the result for this rule.
public final Rule.Condition getCondition()
The ‘condition’ attribute defines the overall condition this rule applies to.
public final java.lang.String getValue()
The ‘value’ attribute defines how the condition is matched.
Copyright © 2014–2019 XMPP.rocks. All rights reserved.