Interface DistanceToFieldProjectionValueStep<N extends DistanceToFieldProjectionOptionsStep<?,T>, T>
- Type Parameters:
N- The next step if a method other thancollector(ProjectionCollector.Provider)is called, i.e. the return type of methods defined inFieldProjectionOptionsStepwhen 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 Summary
Modifier and TypeMethodDescriptiondefault DistanceToFieldProjectionOptionsStep<?, T[]> Defines the projection as multivalued, i.e. returningT[]instead ofT.<R> DistanceToFieldProjectionOptionsStep<?, R> collector(ProjectionCollector.Provider<T, R> collector) Defines how to accumulate distance projection values.default DistanceToFieldProjectionOptionsStep<?, List<T>> list()Defines the projection as multivalued, i.e. returningList<T>instead ofT.default DistanceToFieldProjectionOptionsStep<?, List<T>> multi()Deprecated.default DistanceToFieldProjectionOptionsStep<?, Optional<T>> optional()Defines the projection as single-valued wrapped in anOptional, i.e. returningOptional<T>instead ofT.default DistanceToFieldProjectionOptionsStep<?, Set<T>> set()Defines the projection as multivalued, i.e. returningSet<T>instead ofT.default DistanceToFieldProjectionOptionsStep<?, SortedSet<T>> Defines the projection as multivalued, i.e. returningSortedSet<T>instead ofT.default DistanceToFieldProjectionOptionsStep<?, SortedSet<T>> sortedSet(Comparator<T> comparator) Defines the projection as multivalued, i.e. returningSortedSet<T>instead ofT.Methods inherited from interface DistanceToFieldProjectionOptionsStep
unitMethods inherited from interface ProjectionFinalStep
toProjection
-
Method Details
-
multi
Deprecated.Usecollector(ProjectionCollector.Provider)instead.Defines the projection as multi-valued, i.e. returningList<T>instead ofT.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
Defines the projection as single-valued wrapped in anOptional, i.e. returningOptional<T>instead ofT.- Returns:
- A new step to define optional parameters.
-
list
Defines the projection as multivalued, i.e. returningList<T>instead ofT.- Returns:
- A new step to define optional parameters.
-
set
Defines the projection as multivalued, i.e. returningSet<T>instead ofT.- Returns:
- A new step to define optional parameters.
-
sortedSet
Defines the projection as multivalued, i.e. returningSortedSet<T>instead ofT.- 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. returningSortedSet<T>instead ofT.- Parameters:
comparator- The comparator to use for sorting elements within the set.- Returns:
- A new step to define optional parameters.
-
array
Defines the projection as multivalued, i.e. returningT[]instead ofT.- Parameters:
type- The type of array elements.- Returns:
- A new step to define optional parameters.
-
collector(ProjectionCollector.Provider)instead.