Record Class AnyProjectionReference<SR,T>
java.lang.Object
java.lang.Record
org.hibernate.search.engine.search.reference.projection.AnyProjectionReference<SR,T>
- Type Parameters:
SR
- Scope root typeT
- The type of the projected field.- Record Components:
absolutePath
- The absolut field path.scopeRootType
- The class representing the scope root type.valueModel
- The model of projected values. SeeValueModel
.projectionType
- The class representing the type of the projected field, as pervalueModel
.
- All Implemented Interfaces:
FieldReference<SR>
,DistanceProjectionFieldReference<SR>
,FieldProjectionFieldReference<SR,
,T> HighlightProjectionFieldReference<SR>
,ObjectProjectionFieldReference<SR>
,ProjectionFieldReference<SR>
,TypedProjectionFieldReference<SR,
T>
@Incubating
public record AnyProjectionReference<SR,T> (String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> projectionType)
extends Record
implements DistanceProjectionFieldReference<SR>, FieldProjectionFieldReference<SR,T>, HighlightProjectionFieldReference<SR>, ObjectProjectionFieldReference<SR>
A generic projected-field reference that can be manually created and passed to any projection-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
ConstructorsConstructorDescriptionAnyProjectionReference
(String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> projectionType) Creates an instance of aAnyProjectionReference
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 theprojectionType
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
-
AnyProjectionReference
public AnyProjectionReference(String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> projectionType) Creates an instance of aAnyProjectionReference
record class.- Parameters:
absolutePath
- the value for theabsolutePath
record componentscopeRootType
- the value for thescopeRootType
record componentvalueModel
- the value for thevalueModel
record componentprojectionType
- the value for theprojectionType
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 interfaceTypedProjectionFieldReference<SR,
T> - Returns:
- the value of the
valueModel
record component
-
projectionType
Returns the value of theprojectionType
record component.- Specified by:
projectionType
in interfaceTypedProjectionFieldReference<SR,
T> - Returns:
- the value of the
projectionType
record component
-