Class Rule


  • public final class Rule
    extends 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.

    See Also:
    XEP-0079: Advanced Message Processing, XML Schema
    • 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.