Class AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<T>
java.lang.Object
com.foreach.across.modules.entity.autosuggest.AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<T>
- Enclosing class:
- AutoSuggestDataAttributeRegistrar
Holds the configuration for an
InitializingAutoSuggestDataSet
based on an entity configuration.
An entityType(Class)
can be specified manually but if missing will be resolved from the context.
Likewise if no resultTransformer(Function)
is set, the available entity model will be used.
Suggestions and prefetch queries can be specified as either entity query or a function reference.
The maximumResults(Integer)
property has impact on the number of suggestions
that will be returned. When using an entity query, setting maximum results will also fetch results
using a page request with that size.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCase this configuration for the specific entity type.entityType
(Class<U> entityType) Specify the entity type that this dataset fetches.maximumResults
(Integer maximumResults) prefetchEntityQuery
(Function<String, EntityQuery> prefetchEntityQuery) prefetchEql
(@NonNull String eql) resultTransformer
(Function<T, AutoSuggestDataSet.Result> resultTransformer) suggestions
(BiFunction<String, String, Iterable<? extends T>> suggestions) suggestionsEntityQuery
(BiFunction<String, String, EntityQuery> suggestionsEntityQuery) suggestionsEql
(@NonNull String eql)
-
Constructor Details
-
EntityDataSetConfiguration
public EntityDataSetConfiguration()
-
-
Method Details
-
entityType
public <U extends T> AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<U> entityType(Class<U> entityType) Specify the entity type that this dataset fetches. If not set, the entity type will be derived from the context (either the configuration or property type). -
as
public <U extends T> AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<U> as(Class<U> entityType) Case this configuration for the specific entity type. Provided for readability and less explicit casting in setter methods. -
suggestionsEql
public AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<T> suggestionsEql(@NonNull @NonNull String eql) -
prefetchEql
public AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<T> prefetchEql(@NonNull @NonNull String eql) -
dataSetId
- Returns:
this
.
-
maximumResults
public AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<T> maximumResults(Integer maximumResults) - Returns:
this
.
-
suggestions
public AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<T> suggestions(BiFunction<String, String, Iterable<? extends T>> suggestions) - Returns:
this
.
-
prefetch
public AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<T> prefetch(Function<String, Iterable<? extends T>> prefetch) - Returns:
this
.
-
suggestionsEntityQuery
public AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<T> suggestionsEntityQuery(BiFunction<String, String, EntityQuery> suggestionsEntityQuery) - Returns:
this
.
-
prefetchEntityQuery
public AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<T> prefetchEntityQuery(Function<String, EntityQuery> prefetchEntityQuery) - Returns:
this
.
-
resultTransformer
public AutoSuggestDataAttributeRegistrar.EntityDataSetConfiguration<T> resultTransformer(Function<T, AutoSuggestDataSet.Result> resultTransformer) - Returns:
this
.
-