Class DelegatingSearchProjectionFactory<R,​E>

    • Constructor Detail

    • Method Detail

      • entityReference

        public EntityReferenceProjectionOptionsStep<?,​R> entityReference()
        Description copied from interface: SearchProjectionFactory
        Project to a reference to the entity that was originally indexed.

        The actual type of the reference depends on the mapper used to create the query: the ORM mapper will return a class/identifier pair, for example.

        Specified by:
        entityReference in interface SearchProjectionFactory<R,​E>
        Returns:
        A DSL step where the "entity reference" projection can be defined in more details.
      • entity

        public EntityProjectionOptionsStep<?,​E> entity()
        Description copied from interface: SearchProjectionFactory
        Project to the entity was originally indexed.

        The actual type of the entity depends on the mapper used to create the query and on the indexes targeted by your query: the ORM mapper will return a managed entity loaded from the database, for example.

        Specified by:
        entity in interface SearchProjectionFactory<R,​E>
        Returns:
        A DSL step where the "entity" projection can be defined in more details.
      • field

        public <T> FieldProjectionValueStep<?,​T> field​(String absoluteFieldPath,
                                                             Class<T> type,
                                                             ValueConvert convert)
        Description copied from interface: SearchProjectionFactory
        Project to the value of a field in the indexed document.
        Specified by:
        field in interface SearchProjectionFactory<R,​E>
        Type Parameters:
        T - The resulting type of the projection.
        Parameters:
        absoluteFieldPath - The absolute path of the field.
        type - The resulting type of the projection.
        convert - Controls how the data fetched from the backend should be converted. See ValueConvert.
        Returns:
        A DSL step where the "field" projection can be defined in more details.
      • field

        public FieldProjectionValueStep<?,​Object> field​(String absoluteFieldPath,
                                                              ValueConvert convert)
        Description copied from interface: SearchProjectionFactory
        Project to the value of a field in the indexed document, without specifying a type.
        Specified by:
        field in interface SearchProjectionFactory<R,​E>
        Parameters:
        absoluteFieldPath - The absolute path of the field.
        convert - Controls how the data fetched from the backend should be converted. See ValueConvert.
        Returns:
        A DSL step where the "field" projection can be defined in more details.
      • composite

        public <T> CompositeProjectionOptionsStep<?,​T> composite​(Function<List<?>,​T> transformer,
                                                                       SearchProjection<?>... projections)
        Description copied from interface: SearchProjectionFactory
        Create a projection that will compose a custom object based on the given projections.
        Specified by:
        composite in interface SearchProjectionFactory<R,​E>
        Type Parameters:
        T - The type of the custom object composing the projected elements.
        Parameters:
        transformer - The function that will transform the list of projected elements into a custom object.
        projections - The projections used to populate the list, in order.
        Returns:
        A DSL step where the "composite" projection can be defined in more details.
      • composite

        public <P,​T> CompositeProjectionOptionsStep<?,​T> composite​(Function<P,​T> transformer,
                                                                               SearchProjection<P> projection)
        Description copied from interface: SearchProjectionFactory
        Create a projection that will compose a custom object based on one given projection.
        Specified by:
        composite in interface SearchProjectionFactory<R,​E>
        Type Parameters:
        P - The type of the element passed to the transformer.
        T - The type of the custom object composing the projected element.
        Parameters:
        transformer - The function that will transform the projected element into a custom object.
        projection - The original projection used to produce the element passed to the transformer.
        Returns:
        A DSL step where the "composite" projection can be defined in more details.
      • composite

        public <P1,​P2,​T> CompositeProjectionOptionsStep<?,​T> composite​(BiFunction<P1,​P2,​T> transformer,
                                                                                         SearchProjection<P1> projection1,
                                                                                         SearchProjection<P2> projection2)
        Description copied from interface: SearchProjectionFactory
        Create a projection that will compose a custom object based on two given projections.
        Specified by:
        composite in interface SearchProjectionFactory<R,​E>
        Type Parameters:
        P1 - The type of the first element passed to the transformer.
        P2 - The type of the second element passed to the transformer.
        T - The type of the custom object composing the projected elements.
        Parameters:
        transformer - The function that will transform the projected elements into a custom object.
        projection1 - The projection used to produce the first element passed to the transformer.
        projection2 - The projection used to produce the second element passed to the transformer.
        Returns:
        A DSL step where the "composite" projection can be defined in more details.
      • composite

        public <P1,​P2,​P3,​T> CompositeProjectionOptionsStep<?,​T> composite​(TriFunction<P1,​P2,​P3,​T> transformer,
                                                                                                  SearchProjection<P1> projection1,
                                                                                                  SearchProjection<P2> projection2,
                                                                                                  SearchProjection<P3> projection3)
        Description copied from interface: SearchProjectionFactory
        Create a projection that will compose a custom object based on three given projections.
        Specified by:
        composite in interface SearchProjectionFactory<R,​E>
        Type Parameters:
        P1 - The type of the first element passed to the transformer.
        P2 - The type of the second element passed to the transformer.
        P3 - The type of the third element passed to the transformer.
        T - The type of the custom object composing the projected elements.
        Parameters:
        transformer - The function that will transform the projected elements into a custom object.
        projection1 - The projection used to produce the first element passed to the transformer.
        projection2 - The projection used to produce the second element passed to the transformer.
        projection3 - The projection used to produce the third element passed to the transformer.
        Returns:
        A DSL step where the "composite" projection can be defined in more details.
      • extension

        public <T> T extension​(SearchProjectionFactoryExtension<T,​R,​E> extension)
        Description copied from interface: SearchProjectionFactory
        Extend the current factory with the given extension, resulting in an extended factory offering different types of projections.
        Specified by:
        extension in interface SearchProjectionFactory<R,​E>
        Type Parameters:
        T - The type of factory provided by the extension.
        Parameters:
        extension - The extension to the projection DSL.
        Returns:
        The extended factory.