Record Class AnyAggregationReference<SR,T>

java.lang.Object
java.lang.Record
org.hibernate.search.engine.search.reference.aggregation.AnyAggregationReference<SR,T>
Type Parameters:
SR - Scope root type
T - The type of the aggregated field.
Record Components:
absolutePath - The absolut field path.
scopeRootType - The class representing the scope root type.
valueModel - The model of aggregated values. See ValueModel.
aggregationType - The class representing the type of the aggregated field, as per valueModel.
All Implemented Interfaces:
AggregationFieldReference<SR>, AvgAggregationFieldReference<SR,T>, CountAggregationFieldReference<SR>, CountDistinctAggregationFieldReference<SR>, MaxAggregationFieldReference<SR,T>, MinAggregationFieldReference<SR,T>, RangeAggregationFieldReference<SR,T>, SumAggregationFieldReference<SR,T>, TermsAggregationFieldReference<SR,T>, TypedAggregationFieldReference<SR,T>, FieldReference<SR>

@Incubating public record AnyAggregationReference<SR,T>(String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> aggregationType) extends Record implements AvgAggregationFieldReference<SR,T>, CountAggregationFieldReference<SR>, CountDistinctAggregationFieldReference<SR>, MaxAggregationFieldReference<SR,T>, MinAggregationFieldReference<SR,T>, RangeAggregationFieldReference<SR,T>, SumAggregationFieldReference<SR,T>, TermsAggregationFieldReference<SR,T>
A generic aggregated-field reference that can be manually created and passed to any aggregation-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

    • AnyAggregationReference

      public AnyAggregationReference(String absolutePath, Class<SR> scopeRootType, ValueModel valueModel, Class<T> aggregationType)
      Creates an instance of a AnyAggregationReference 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
      aggregationType - the value for the aggregationType 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 TypedAggregationFieldReference<SR,T>
      Returns:
      the value of the valueModel record component
    • aggregationType

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