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 typeT
- 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. SeeValueModel
.predicateType
- The class representing the type of the field used in a predicate, as pervalueModel
.
- 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>
@Incubating
public record AnyPredicateReference<SR,T> (String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> predicateType)
extends Record
implements ExistsPredicateFieldReference<SR>, KnnPredicateFieldReference<SR,T>, MatchPredicateFieldReference<SR,T>, NestedPredicateFieldReference<SR>, PhrasePredicateFieldReference<SR,T>, PrefixPredicateFieldReference<SR>, QueryStringPredicateFieldReference<SR,T>, RangePredicateFieldReference<SR,T>, RegexpPredicateFieldReference<SR>, SimpleQueryStringPredicateFieldReference<SR,T>, SpatialPredicateFieldReference<SR>, TermsPredicateFieldReference<SR>, 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 Summary
ConstructorsConstructorDescriptionAnyPredicateReference
(String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> predicateType) Creates an instance of aAnyPredicateReference
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theabsolutePath
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thepredicateType
record component.Returns the value of thescopeRootType
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thevalueModel
record component.
-
Constructor Details
-
AnyPredicateReference
public AnyPredicateReference(String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> predicateType) Creates an instance of aAnyPredicateReference
record class.- Parameters:
absolutePath
- the value for theabsolutePath
record componentscopeRootType
- the value for thescopeRootType
record componentvalueModel
- the value for thevalueModel
record componentpredicateType
- the value for thepredicateType
record component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
absolutePath
Returns the value of theabsolutePath
record component.- Specified by:
absolutePath
in interfaceFieldReference<SR>
- Returns:
- the value of the
absolutePath
record component
-
scopeRootType
Returns the value of thescopeRootType
record component.- Specified by:
scopeRootType
in interfaceFieldReference<SR>
- Returns:
- the value of the
scopeRootType
record component
-
valueModel
Returns the value of thevalueModel
record component.- Specified by:
valueModel
in interfaceTypedPredicateFieldReference<SR,
T> - Returns:
- the value of the
valueModel
record component
-
predicateType
Returns the value of thepredicateType
record component.- Specified by:
predicateType
in interfaceTypedPredicateFieldReference<SR,
T> - Returns:
- the value of the
predicateType
record component
-