Package com.blazebit.query.spi
Interface DataFetcherConfig<T>
- Type Parameters:
T
- The config value type
public interface DataFetcherConfig<T>
A config for
DataFetcher
.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionfind
(DataFetchContext context) Returns the config value registered in theDataFetchContext
ornull
if no value exists.findAll
(DataFetchContext context) Returns the config value registered in theDataFetchContext
ornull
if no value exists.static <T> DataFetcherConfig<T>
forPropertyName
(String propertyName) Creates a new DataFetcherConfig object, that looks up a value inDataFetchContext
by the given property name.default T
get
(DataFetchContext context) Returns the config value registered in theDataFetchContext
.getAll
(DataFetchContext context) Returns the config value registered in theDataFetchContext
ornull
if no value exists.Returns the property name for the config.
-
Method Details
-
getPropertyName
String getPropertyName()Returns the property name for the config.- Returns:
- the property name for the config
-
find
Returns the config value registered in theDataFetchContext
ornull
if no value exists.- Parameters:
context
- The data fetch context- Returns:
- The config value or
null
-
findAll
Returns the config value registered in theDataFetchContext
ornull
if no value exists.- Parameters:
context
- The data fetch context- Returns:
- The config value or
null
-
get
Returns the config value registered in theDataFetchContext
.- Parameters:
context
- The data fetch context- Returns:
- The config value
- Throws:
IllegalStateException
- If no value was found for this DataFetcherConfig
-
getAll
Returns the config value registered in theDataFetchContext
ornull
if no value exists.- Parameters:
context
- The data fetch context- Returns:
- The config value or
null
-
forPropertyName
Creates a new DataFetcherConfig object, that looks up a value inDataFetchContext
by the given property name.- Type Parameters:
T
- The config value type- Parameters:
propertyName
- The config property name- Returns:
- A new DataFetcherConfig object
-