Class Filter

java.lang.Object
com.google.cloud.firestore.Filter

public class Filter extends Object
  • Constructor Details

    • Filter

      public Filter()
  • Method Details

    • equalTo

      @Nonnull public static Filter equalTo(@Nonnull String field, @Nullable Object value)
      Creates a new filter for checking that the given field is equal to the given value.
      Parameters:
      field - The field used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • equalTo

      @Nonnull public static Filter equalTo(@Nonnull FieldPath fieldPath, @Nullable Object value)
      Creates a new filter for checking that the given field is equal to the given value.
      Parameters:
      fieldPath - The field path used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • notEqualTo

      @Nonnull public static Filter notEqualTo(@Nonnull String field, @Nullable Object value)
      Creates a new filter for checking that the given field is not equal to the given value.
      Parameters:
      field - The field used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • notEqualTo

      @Nonnull public static Filter notEqualTo(@Nonnull FieldPath fieldPath, @Nullable Object value)
      Creates a new filter for checking that the given field is not equal to the given value.
      Parameters:
      fieldPath - The field path used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • greaterThan

      @Nonnull public static Filter greaterThan(@Nonnull String field, @Nullable Object value)
      Creates a new filter for checking that the given field is greater than the given value.
      Parameters:
      field - The field used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • greaterThan

      @Nonnull public static Filter greaterThan(@Nonnull FieldPath fieldPath, @Nullable Object value)
      Creates a new filter for checking that the given field is greater than the given value.
      Parameters:
      fieldPath - The field path used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • greaterThanOrEqualTo

      @Nonnull public static Filter greaterThanOrEqualTo(@Nonnull String field, @Nullable Object value)
      Creates a new filter for checking that the given field is greater than or equal to the given value.
      Parameters:
      field - The field used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • greaterThanOrEqualTo

      @Nonnull public static Filter greaterThanOrEqualTo(@Nonnull FieldPath fieldPath, @Nullable Object value)
      Creates a new filter for checking that the given field is greater than or equal to the given value.
      Parameters:
      fieldPath - The field path used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • lessThan

      @Nonnull public static Filter lessThan(@Nonnull String field, @Nullable Object value)
      Creates a new filter for checking that the given field is less than the given value.
      Parameters:
      field - The field used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • lessThan

      @Nonnull public static Filter lessThan(@Nonnull FieldPath fieldPath, @Nullable Object value)
      Creates a new filter for checking that the given field is less than the given value.
      Parameters:
      fieldPath - The field path used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • lessThanOrEqualTo

      @Nonnull public static Filter lessThanOrEqualTo(@Nonnull String field, @Nullable Object value)
      Creates a new filter for checking that the given field is less than or equal to the given value.
      Parameters:
      field - The field used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • lessThanOrEqualTo

      @Nonnull public static Filter lessThanOrEqualTo(@Nonnull FieldPath fieldPath, @Nullable Object value)
      Creates a new filter for checking that the given field is less than or equal to the given value.
      Parameters:
      fieldPath - The field path used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • arrayContains

      @Nonnull public static Filter arrayContains(@Nonnull String field, @Nullable Object value)
      Creates a new filter for checking that the given array field contains the given value.
      Parameters:
      field - The field used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • arrayContains

      @Nonnull public static Filter arrayContains(@Nonnull FieldPath fieldPath, @Nullable Object value)
      Creates a new filter for checking that the given array field contains the given value.
      Parameters:
      fieldPath - The field path used for the filter.
      value - The value used for the filter.
      Returns:
      The newly created filter.
    • arrayContainsAny

      @Nonnull public static Filter arrayContainsAny(@Nonnull String field, @Nullable Object value)
      Creates a new filter for checking that the given array field contains any of the given values.
      Parameters:
      field - The field used for the filter.
      value - The list of values used for the filter.
      Returns:
      The newly created filter.
    • arrayContainsAny

      @Nonnull public static Filter arrayContainsAny(@Nonnull FieldPath fieldPath, @Nullable Object value)
      Creates a new filter for checking that the given array field contains any of the given values.
      Parameters:
      fieldPath - The field path used for the filter.
      value - The list of values used for the filter.
      Returns:
      The newly created filter.
    • inArray

      @Nonnull public static Filter inArray(@Nonnull String field, @Nullable Object value)
      Creates a new filter for checking that the given field equals any of the given values.
      Parameters:
      field - The field used for the filter.
      value - The list of values used for the filter.
      Returns:
      The newly created filter.
    • inArray

      @Nonnull public static Filter inArray(@Nonnull FieldPath fieldPath, @Nullable Object value)
      Creates a new filter for checking that the given field equals any of the given values.
      Parameters:
      fieldPath - The field path used for the filter.
      value - The list of values used for the filter.
      Returns:
      The newly created filter.
    • notInArray

      @Nonnull public static Filter notInArray(@Nonnull String field, @Nullable Object value)
      Creates a new filter for checking that the given field does not equal any of the given values.
      Parameters:
      field - The field path used for the filter.
      value - The list of values used for the filter.
      Returns:
      The newly created filter.
    • notInArray

      @Nonnull public static Filter notInArray(@Nonnull FieldPath fieldPath, @Nullable Object value)
      Creates a new filter for checking that the given field does not equal any of the given values.
      Parameters:
      fieldPath - The field path used for the filter.
      value - The list of values used for the filter.
      Returns:
      The newly created filter.
    • or

      @Nonnull public static Filter or(Filter... filters)
      Creates a new filter that is a disjunction of the given filters. A disjunction filter includes a document if it satisfies any of the given filters.
      Parameters:
      filters - The list of filters to perform a disjunction for.
      Returns:
      The newly created filter.
    • and

      @Nonnull public static Filter and(Filter... filters)
      Creates a new filter that is a conjunction of the given filters. A conjunction filter includes a document if it satisfies all of the given filters.
      Parameters:
      filters - The list of filters to perform a conjunction for.
      Returns:
      The newly created filter.