Interface DistanceToFieldProjectionValueStep<N extends DistanceToFieldProjectionOptionsStep<?,T>,T>

Type Parameters:
N - The next step if a method other than collector(ProjectionCollector.Provider) is called, i.e. the return type of methods defined in FieldProjectionOptionsStep when called directly on this object.
T - The type of projected distances.
All Superinterfaces:
DistanceToFieldProjectionOptionsStep<N,T>, ProjectionFinalStep<T>

public interface DistanceToFieldProjectionValueStep<N extends DistanceToFieldProjectionOptionsStep<?,T>,T> extends DistanceToFieldProjectionOptionsStep<N,T>
The initial step in a "distance to field" projection definition, where (optionally) the projection collector can be provided, e.g. to mark a projection as multi-valued (returning List/Set etc.) or wrapped in some other container (e.g. Optional<..>), and where optional parameters can be set.

By default (if collector(ProjectionCollector.Provider) is not called), the projection is considered single-valued, and its creation will fail if the field is multi-valued.

  • Method Details

    • multi

      Deprecated.
      Defines the projection as multi-valued, i.e. returning List<T> instead of T.

      Calling multi() is mandatory for multi-valued fields, otherwise the projection will throw an exception upon creating the query.

      Returns:
      A new step to define optional parameters for the multi-valued projections.
    • collector

      @Incubating <R> DistanceToFieldProjectionOptionsStep<?,R> collector(ProjectionCollector.Provider<T,R> collector)
      Defines how to accumulate distance projection values.

      Calling .collector(someMultiValuedCollectorProvider) is mandatory for multi-valued fields, e.g. .collector(ProjectionCollector.list()), otherwise the projection will throw an exception upon creating the query.

      Type Parameters:
      R - The type of the final result.
      Parameters:
      collector - The collector provider to apply to this projection.
      Returns:
      A new step to define optional parameters for the accumulated projections.
    • optional

      @Incubating default DistanceToFieldProjectionOptionsStep<?,Optional<T>> optional()
      Defines the projection as single-valued wrapped in an Optional, i.e. returning Optional<T> instead of T.
      Returns:
      A new step to define optional parameters.
    • list

      @Incubating default DistanceToFieldProjectionOptionsStep<?,List<T>> list()
      Defines the projection as multivalued, i.e. returning List<T> instead of T.
      Returns:
      A new step to define optional parameters.
    • set

      @Incubating default DistanceToFieldProjectionOptionsStep<?,Set<T>> set()
      Defines the projection as multivalued, i.e. returning Set<T> instead of T.
      Returns:
      A new step to define optional parameters.
    • sortedSet

      @Incubating default DistanceToFieldProjectionOptionsStep<?,SortedSet<T>> sortedSet()
      Defines the projection as multivalued, i.e. returning SortedSet<T> instead of T.
      Returns:
      A new step to define optional parameters.
    • sortedSet

      @Incubating default DistanceToFieldProjectionOptionsStep<?,SortedSet<T>> sortedSet(Comparator<T> comparator)
      Defines the projection as multivalued, i.e. returning SortedSet<T> instead of T.
      Parameters:
      comparator - The comparator to use for sorting elements within the set.
      Returns:
      A new step to define optional parameters.
    • array

      @Incubating default DistanceToFieldProjectionOptionsStep<?,T[]> array(Class<T> type)
      Defines the projection as multivalued, i.e. returning T[] instead of T.
      Parameters:
      type - The type of array elements.
      Returns:
      A new step to define optional parameters.