Class LiveDataQuery.Filter

  • Enclosing class:
    LiveDataQuery

    public static class LiveDataQuery.Filter
    extends Object
    A set of constraints to apply to a given property.
    • Constructor Detail

      • Filter

        public Filter()
        Default constructor.
      • Filter

        public Filter​(String property,
                      Object value)
        Creates a new filter for the specified property, using the given value.
        Parameters:
        property - the property to filter on
        value - the value to match, using the default operator for the specified property
      • Filter

        public Filter​(String property,
                      String operator,
                      Object value)
        Creates a new filter for the specified property, using the given value.
        Parameters:
        property - the property to filter on
        operator - the operator to use to match the given value (e.g. 'equals', 'contains', 'startsWith')
        value - the value to match, using the specified operator
      • Filter

        public Filter​(String property,
                      boolean matchAll,
                      Object... values)
        Creates a new filter for the specified property, using the given values.
        Parameters:
        property - the property to filter on
        matchAll - whether to match all the given values or any of them
        values - the values to match, using the default operator for the specified property
      • Filter

        public Filter​(String property,
                      String operator,
                      boolean matchAll,
                      Object... values)
        Creates a new filter for the specified property, using the given values.
        Parameters:
        property - the property to filter on
        operator - the operator to use to match the given values (e.g. 'equals', 'contains', 'startsWith')
        matchAll - whether to match all the given values or any of them
        values - the values to match, using the specified operator
    • Method Detail

      • getProperty

        public String getProperty()
        Returns:
        the property to filter
      • setProperty

        public void setProperty​(String property)
        Sets the property to filter.
        Parameters:
        property - the property to filter
      • isMatchAll

        public boolean isMatchAll()
        Returns:
        true if all the getConstraints() have to be met, false if any of them need to be satisfied
      • setMatchAll

        public void setMatchAll​(boolean matchAll)
        Sets whether the property value needs to match all the constraints or any.
        Parameters:
        matchAll - true to match all constraints, false to match any of them