Package org.apache.flink.configuration
Class ConfigUtils
- java.lang.Object
-
- org.apache.flink.configuration.ConfigUtils
-
@Internal public class ConfigUtils extends Object
General utilities for parsing values to configuration options.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <IN,OUT,E extends Throwable>
List<OUT>decodeListFromConfig(ReadableConfig configuration, ConfigOption<List<IN>> key, org.apache.flink.util.function.FunctionWithException<IN,OUT,E> mapper)Gets aListof values of typeINfrom aReadableConfigand transforms it to aListof typeOUTbased on the providedmapperfunction.static <IN,OUT>
voidencodeArrayToConfig(WritableConfig configuration, ConfigOption<List<OUT>> key, IN[] values, Function<IN,OUT> mapper)static <IN,OUT>
voidencodeCollectionToConfig(WritableConfig configuration, ConfigOption<List<OUT>> key, Collection<IN> values, Function<IN,OUT> mapper)Puts aCollectionof values of typeINin aWritableConfigas aConfigOptionof typeListof typeOUT.static Set<ConfigOption<?>>getAllConfigOptions(Class<?> configOptionsClass)
-
-
-
Method Detail
-
encodeArrayToConfig
public static <IN,OUT> void encodeArrayToConfig(WritableConfig configuration, ConfigOption<List<OUT>> key, @Nullable IN[] values, Function<IN,OUT> mapper)
Puts an array of values of typeINin aWritableConfigas aConfigOptionof typeListof typeOUT. If thevaluesisnullor empty, then nothing is put in the configuration.- Parameters:
configuration- the configuration object to put the list inkey- theoptionto serve as the key for the list in the configurationvalues- the array of values to put as value for thekeymapper- the transformation function fromINtoOUT.
-
encodeCollectionToConfig
public static <IN,OUT> void encodeCollectionToConfig(WritableConfig configuration, ConfigOption<List<OUT>> key, @Nullable Collection<IN> values, Function<IN,OUT> mapper)
Puts aCollectionof values of typeINin aWritableConfigas aConfigOptionof typeListof typeOUT. If thevaluesisnullor empty, then nothing is put in the configuration.- Parameters:
configuration- the configuration object to put the list inkey- theoptionto serve as the key for the list in the configurationvalues- the collection of values to put as value for thekeymapper- the transformation function fromINtoOUT.
-
decodeListFromConfig
public static <IN,OUT,E extends Throwable> List<OUT> decodeListFromConfig(ReadableConfig configuration, ConfigOption<List<IN>> key, org.apache.flink.util.function.FunctionWithException<IN,OUT,E> mapper) throws E extends Throwable
Gets aListof values of typeINfrom aReadableConfigand transforms it to aListof typeOUTbased on the providedmapperfunction.
-
getAllConfigOptions
public static Set<ConfigOption<?>> getAllConfigOptions(Class<?> configOptionsClass) throws IllegalStateException
- Throws:
IllegalStateException
-
-