Record Class AnySortReference<SR,T>
java.lang.Object
java.lang.Record
org.hibernate.search.engine.search.reference.sort.AnySortReference<SR,T>
- Type Parameters:
SR- Scope root typeT- The type of the sorted field.- Record Components:
absolutePath- The absolut field path.scopeRootType- The class representing the scope root type.valueModel- The model of sort values. SeeValueModel.sortType- The class representing the type of the sorted field, as pervalueModel.
- All Implemented Interfaces:
FieldReference<SR>,DistanceSortFieldReference<SR>,FieldSortFieldReference<SR,,T> ScoreSortFieldReference<SR,,T> SortFieldReference<SR>,TypedSortFieldReference<SR,T>
@Incubating
public record AnySortReference<SR,T> (String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> sortType)
extends Record
implements DistanceSortFieldReference<SR>, FieldSortFieldReference<SR,T>, ScoreSortFieldReference<SR,T>
A generic sort-field reference that can be manually created and passed to any sort-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
ConstructorsConstructorDescriptionAnySortReference(String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> sortType) Creates an instance of aAnySortReferencerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theabsolutePathrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thescopeRootTyperecord component.sortType()Returns the value of thesortTyperecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevalueModelrecord component.
-
Constructor Details
-
AnySortReference
public AnySortReference(String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> sortType) Creates an instance of aAnySortReferencerecord class.- Parameters:
absolutePath- the value for theabsolutePathrecord componentscopeRootType- the value for thescopeRootTyperecord componentvalueModel- the value for thevalueModelrecord componentsortType- the value for thesortTyperecord 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 theabsolutePathrecord component.- Specified by:
absolutePathin interfaceFieldReference<SR>- Returns:
- the value of the
absolutePathrecord component
-
scopeRootType
Returns the value of thescopeRootTyperecord component.- Specified by:
scopeRootTypein interfaceFieldReference<SR>- Returns:
- the value of the
scopeRootTyperecord component
-
valueModel
Returns the value of thevalueModelrecord component.- Specified by:
valueModelin interfaceTypedSortFieldReference<SR,T> - Returns:
- the value of the
valueModelrecord component
-
sortType
Returns the value of thesortTyperecord component.- Specified by:
sortTypein interfaceTypedSortFieldReference<SR,T> - Returns:
- the value of the
sortTyperecord component
-