# Interface ConfigParameterFactory

public interface ConfigParameterFactory
Provides a mapping from ConfigKeys to Parameters. Although the implementation of simply adapting from ConfigKey to Parameter is provided by the `ConfigParameter` class, implementations of this class are often required to do considerably more work in the context of the supplied execution `Environment`, including working out a parameter name based on variants of the key name including relevant layer/zone suffixes, configuring the parameters with suitable defaults, etc.

This interface is used extensively by `AbstractPlot2Task`.

This looks like it should be marked as a `FunctionalInterface`, and the compiler does permit that, but I can't figure out how to write a lambda expression corresponding to a Single Abstract Method like the one here which is parameterised by a type T, so there doesn't seem much point. I don't think it's possible; the Java Language Specification (JLS SE8, Sec 15.27) says "Lambda expressions cannot declare type parameters".

Since:
  23 Aug 2023
Author:
  Mark Taylor

## Method Summary

Modifier and Type
Method
Description
`<T> ConfigParameter<T>`
`getParameter(uk.ac.starlink.task.Environment env, ConfigKey<T> key)`
Produces a parameter to find the value for a given config key.

## Method Details

### getParameter

<T> ConfigParameter<T> getParameter(uk.ac.starlink.task.Environment env, ConfigKey<T> key) throws uk.ac.starlink.task.TaskException
Produces a parameter to find the value for a given config key.

Parameters:
  `env` - execution environment
  `key` - config key
Returns:
  parameter that can get a value for `key`
Throws:
  `uk.ac.starlink.task.TaskException`