Record Class AnyPredicateReference<SR,T>

java.lang.Object
java.lang.Record
org.hibernate.search.engine.search.reference.predicate.AnyPredicateReference<SR,T>
Type Parameters:
SR - Scope root type
T - The type of the field used in a predicate.
Record Components:
absolutePath - The absolut field path.
scopeRootType - The class representing the scope root type.
valueModel - The model of values used in the predicate. See ValueModel.
predicateType - The class representing the type of the field used in a predicate, as per valueModel.
All Implemented Interfaces:
FieldReference<SR>, ExistsPredicateFieldReference<SR>, KnnPredicateFieldReference<SR,T>, MatchPredicateFieldReference<SR,T>, NestedPredicateFieldReference<SR>, PhrasePredicateFieldReference<SR,T>, PredicateFieldReference<SR>, PrefixPredicateFieldReference<SR>, QueryStringPredicateFieldReference<SR,T>, RangePredicateFieldReference<SR,T>, RegexpPredicateFieldReference<SR>, SimpleQueryStringPredicateFieldReference<SR,T>, SpatialPredicateFieldReference<SR>, TermsPredicateFieldReference<SR>, TypedPredicateFieldReference<SR,T>, WildcardPredicateFieldReference<SR>

A generic predicate-field reference that can be manually created and passed to any predicate-DSL methods that require a field reference.

While it is expected that the generated Hibernate Search static metamodel will contain more precise field references that would match the actual field capabilities, this generic reference can be used by the users if they decide to opt-out of using the generated static metamodel and would just want to create a few simple pre-defined references.

  • Constructor Details

    • AnyPredicateReference

      public AnyPredicateReference(String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> predicateType)
      Creates an instance of a AnyPredicateReference record class.
      Parameters:
      absolutePath - the value for the absolutePath record component
      scopeRootType - the value for the scopeRootType record component
      valueModel - the value for the valueModel record component
      predicateType - the value for the predicateType record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • absolutePath

      public String absolutePath()
      Returns the value of the absolutePath record component.
      Specified by:
      absolutePath in interface FieldReference<SR>
      Returns:
      the value of the absolutePath record component
    • scopeRootType

      public Class<SR> scopeRootType()
      Returns the value of the scopeRootType record component.
      Specified by:
      scopeRootType in interface FieldReference<SR>
      Returns:
      the value of the scopeRootType record component
    • valueModel

      public ValueModel valueModel()
      Returns the value of the valueModel record component.
      Specified by:
      valueModel in interface TypedPredicateFieldReference<SR,T>
      Returns:
      the value of the valueModel record component
    • predicateType

      public Class<T> predicateType()
      Returns the value of the predicateType record component.
      Specified by:
      predicateType in interface TypedPredicateFieldReference<SR,T>
      Returns:
      the value of the predicateType record component