Interface ProjectionAccumulator<E,V,A,R>

Type Parameters:
E - The type of extracted values to accumulate before being transformed.
V - The type of values to accumulate obtained by transforming extracted values (E).
A - The type of the temporary storage for accumulated values, before and after being transformed.
R - The type of the final result containing values of type V.
All Superinterfaces:
ProjectionCollector<E,V,A,R>

@Deprecated(since="8.0") public interface ProjectionAccumulator<E,V,A,R> extends ProjectionCollector<E,V,A,R>
Deprecated.
Use ProjectionCollector instead.
A variation on Collector suitable for projections on field values.

Compared to Collector:

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Deprecated.
    Provides an accumulator for a given type of values to accumulate (T).
  • Method Summary

    Modifier and Type
    Method
    Description
    accumulate(A accumulated, E value)
    Deprecated.
    Folds a new value in the given accumulated container.
    default A
    accumulateAll(A accumulated, Collection<E> values)
    Deprecated.
    Folds a collection of new values in the given accumulated container.
    Deprecated.
    Creates the initial accumulated container.
    finish(A accumulated)
    Deprecated.
    Finishes the accumulation, converting the accumulated container into the final result.
    get(A accumulated, int index)
    Deprecated.
    Retrieves the value at the given index.
    Deprecated.
     
    Deprecated.
     
    int
    size(A accumulated)
    Deprecated.
     
    transform(A accumulated, int index, V transformed)
    Deprecated.
    Transforms the value at the given index, replacing it with the given transformed value.
    default A
    transformAll(A accumulated, ProjectionConverter<? super E,? extends V> converter, FromDocumentValueConvertContext context)
    Deprecated.
    Transforms all values with the given converter and the given context.

    Methods inherited from interface org.hibernate.search.engine.search.projection.ProjectionCollector

    empty, transformAll
  • Method Details

    • single

      static <V> ProjectionAccumulator.Provider<V,V> single()
      Deprecated.
    • list

      static <V> ProjectionAccumulator.Provider<V,List<V>> list()
      Deprecated.
    • createInitial

      A createInitial()
      Deprecated.
      Creates the initial accumulated container.

      This operation should be non-blocking.

      Specified by:
      createInitial in interface ProjectionCollector<E,V,A,R>
      Returns:
      The initial accumulated container, to pass to the first call to accumulate(Object, Object).
    • accumulate

      A accumulate(A accumulated, E value)
      Deprecated.
      Folds a new value in the given accumulated container.

      This operation should be non-blocking.

      Specified by:
      accumulate in interface ProjectionCollector<E,V,A,R>
      Parameters:
      accumulated - The accumulated value so far. For the first call, this is a value returned by createInitial(). For the next calls, this is the value returned by the previous call to accumulate(Object, Object).
      value - The value to accumulate.
      Returns:
      The new accumulated value.
    • accumulateAll

      default A accumulateAll(A accumulated, Collection<E> values)
      Deprecated.
      Folds a collection of new values in the given accumulated container.

      This operation should be non-blocking.

      Specified by:
      accumulateAll in interface ProjectionCollector<E,V,A,R>
      Parameters:
      accumulated - The accumulated value so far. For the first call, this is a value returned by createInitial(). For the next calls, this is the value returned by the previous call to accumulate(Object, Object).
      values - The values to accumulate.
      Returns:
      The new accumulated value.
    • size

      int size(A accumulated)
      Deprecated.
      Specified by:
      size in interface ProjectionCollector<E,V,A,R>
      Parameters:
      accumulated - The accumulated value so far, returned by the last call to accumulate(Object, Object).
      Returns:
      The number of elements in the accumulated value.
    • get

      E get(A accumulated, int index)
      Deprecated.
      Retrieves the value at the given index.

      This operation should be non-blocking.

      Specified by:
      get in interface ProjectionCollector<E,V,A,R>
      Parameters:
      accumulated - The accumulated value so far, returned by the last call to accumulate(Object, Object).
      index - The index of the value to retrieve.
      Returns:
      The value at the given index.
    • transform

      A transform(A accumulated, int index, V transformed)
      Deprecated.
      Transforms the value at the given index, replacing it with the given transformed value.

      This operation should be non-blocking.

      Specified by:
      transform in interface ProjectionCollector<E,V,A,R>
      Parameters:
      accumulated - The accumulated value so far, returned by the last call to accumulate(Object, Object).
      index - The index of the value being transformed.
      transformed - The transformed value.
      Returns:
      The new accumulated value.
    • transformAll

      default A transformAll(A accumulated, ProjectionConverter<? super E,? extends V> converter, FromDocumentValueConvertContext context)
      Deprecated.
      Transforms all values with the given converter and the given context.

      This operation may be blocking.

      Parameters:
      accumulated - The accumulated value so far, returned by the last call to accumulate(Object, Object).
      converter - The projection converter (from F to V).
      context - The context to be passed to the projection converter.
      Returns:
      The new accumulated value.
    • finish

      R finish(A accumulated)
      Deprecated.
      Finishes the accumulation, converting the accumulated container into the final result.

      This operation may be blocking.

      Specified by:
      finish in interface ProjectionCollector<E,V,A,R>
      Parameters:
      accumulated - The temporary storage created by createInitial(), then populated by successive calls to accumulate(Object, Object), then transformed by a single call to transformAll(Object, ProjectionConverter, FromDocumentValueConvertContext) or by successive calls to transform(Object, int, Object).
      Returns:
      The final result of the accumulation.