java.lang.Object
com.azure.messaging.servicebus.administration.models.RuleFilter
com.azure.messaging.servicebus.administration.models.SqlRuleFilter
Direct Known Subclasses:
FalseRuleFilter, TrueRuleFilter

public class SqlRuleFilter extends RuleFilter
Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline.

A SqlRuleFilter holds a SQL-like condition expression that is evaluated in the broker against the arriving messages' user-defined properties and system properties. All system properties (which are all properties explicitly listed on the ServiceBusMessage class) must be prefixed with sys. in the condition expression. The SQL subset implements testing for existence of properties (EXISTS), testing for null-values (IS NULL), logical NOT/AND/OR, relational operators, numeric arithmetic, and simple text pattern matching with LIKE.

See Also:
  • Constructor Details

    • SqlRuleFilter

      public SqlRuleFilter(String sqlExpression)
      Creates a new instance with the given SQL expression.
      Parameters:
      sqlExpression - SQL expression for the filter.
      Throws:
      NullPointerException - if sqlExpression is null.
      IllegalArgumentException - if sqlExpression is an empty string.
  • Method Details

    • getParameters

      public Map<String,Object> getParameters()
      Gets the value of a filter expression. Allowed types: string, int, long, bool, double
      Returns:
      Gets the value of a filter expression.
    • getSqlExpression

      public String getSqlExpression()
      Gets the SQL expression.
      Returns:
      The SQL expression.
    • toString

      public String toString()
      Converts the value of the current instance to its equivalent string representation.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the current instance.
    • equals

      public boolean equals(Object other)
      Compares this RuleFilter to the specified object. The result is true if and only if the argument is not null and is a SqlRuleFilter object that with the same parameters as this object.
      Overrides:
      equals in class Object
      Parameters:
      other - - the object to which the current SqlRuleFilter should be compared.
      Returns:
      True, if the passed object is a SqlRuleFilter with the same parameter values, False otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code for this SqlRuleFilter, which is the hashcode for the SqlExpression.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.