Interface DataFetcherConfig<T>

Type Parameters:
T - The config value type

public interface DataFetcherConfig<T>
A config for DataFetcher.
Since:
1.0.0
  • Method Details

    • getPropertyName

      String getPropertyName()
      Returns the property name for the config.
      Returns:
      the property name for the config
    • find

      T find(DataFetchContext context)
      Returns the config value registered in the DataFetchContext or null if no value exists.
      Parameters:
      context - The data fetch context
      Returns:
      The config value or null
    • findAll

      default List<T> findAll(DataFetchContext context)
      Returns the config value registered in the DataFetchContext or null if no value exists.
      Parameters:
      context - The data fetch context
      Returns:
      The config value or null
    • get

      default T get(DataFetchContext context)
      Returns the config value registered in the DataFetchContext.
      Parameters:
      context - The data fetch context
      Returns:
      The config value
      Throws:
      IllegalStateException - If no value was found for this DataFetcherConfig
    • getAll

      default List<T> getAll(DataFetchContext context)
      Returns the config value registered in the DataFetchContext or null if no value exists.
      Parameters:
      context - The data fetch context
      Returns:
      The config value or null
    • forPropertyName

      static <T> DataFetcherConfig<T> forPropertyName(String propertyName)
      Creates a new DataFetcherConfig object, that looks up a value in DataFetchContext by the given property name.
      Type Parameters:
      T - The config value type
      Parameters:
      propertyName - The config property name
      Returns:
      A new DataFetcherConfig object