Interface ContainerExtractor<C,V>

Type Parameters:
C - The type of containers this extractor can extract values from.
V - The type of values extracted by this extractor.

@Incubating public interface ContainerExtractor<C,V>
An extractor of values from a container.

Container extractors tell Hibernate Search how to extract values from object properties: no extractor would mean using the property value directly, a collection element extractor would extract each element of a collection, a map keys extractor would extract each key of a map, etc.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    <T, C2> void
    extract(C container, ValueProcessor<T,? super V,C2> perValueProcessor, T target, C2 context, ContainerExtractionContext extractionContext)
     
    default boolean
     
  • Method Details

    • extract

      <T, C2> void extract(C container, ValueProcessor<T,? super V,C2> perValueProcessor, T target, C2 context, ContainerExtractionContext extractionContext)
      Type Parameters:
      T - The type of the target of the perValueProcessor, i.e. whatever it is supposed to push the result of its processing to.
      C2 - The type of the context of the perValueProcessor, i.e. whatever information it needs that is independent from the target or value.
      Parameters:
      container - A container to extract values from.
      perValueProcessor - A processor for values extracted from the container.
      target - The target to pass to the perValueProcessor.
      context - The context to pass to the perValueProcessor.
      extractionContext - A context for use by the container extractor itself.
    • multiValued

      default boolean multiValued()
      Returns:
      true if this extractor's extract(Object, ValueProcessor, Object, Object, ContainerExtractionContext) method may call the consumer multiple times. false if it will always call the consumer either zero or one time for a given container.