All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.redis.om.spring.search.stream.predicates.SearchFieldPredicate Maven / Gradle / Ivy

package com.redis.om.spring.search.stream.predicates;

import java.lang.reflect.Field;
import java.util.Objects;
import java.util.function.Predicate;

import io.redisearch.Schema.FieldType;
import io.redisearch.querybuilder.Node;

public interface SearchFieldPredicate extends Predicate {
  FieldType getSearchFieldType();

  Field getField();

  @SuppressWarnings("unchecked")
  @Override
  default Predicate or(Predicate other) {
    Objects.requireNonNull(other);
    OrPredicate orPredicate = new OrPredicate<>(this);
    orPredicate.addPredicate((Predicate) other);

    return orPredicate;
  }

  @SuppressWarnings("unchecked")
  @Override
  default Predicate and(Predicate other) {
    Objects.requireNonNull(other);
    AndPredicate andPredicate = new AndPredicate<>(this);
    andPredicate.addPredicate((Predicate) other);

    return andPredicate;
  }

  default Node apply(Node node) {
    return node;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy