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 aList
of values of typeIN
from aReadableConfig
and transforms it to aList
of typeOUT
based on the providedmapper
function.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 aCollection
of values of typeIN
in aWritableConfig
as aConfigOption
of typeList
of 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 typeIN
in aWritableConfig
as aConfigOption
of typeList
of typeOUT
. If thevalues
isnull
or empty, then nothing is put in the configuration.- Parameters:
configuration
- the configuration object to put the list inkey
- theoption
to serve as the key for the list in the configurationvalues
- the array of values to put as value for thekey
mapper
- the transformation function fromIN
toOUT
.
-
encodeCollectionToConfig
public static <IN,OUT> void encodeCollectionToConfig(WritableConfig configuration, ConfigOption<List<OUT>> key, @Nullable Collection<IN> values, Function<IN,OUT> mapper)
Puts aCollection
of values of typeIN
in aWritableConfig
as aConfigOption
of typeList
of typeOUT
. If thevalues
isnull
or empty, then nothing is put in the configuration.- Parameters:
configuration
- the configuration object to put the list inkey
- theoption
to serve as the key for the list in the configurationvalues
- the collection of values to put as value for thekey
mapper
- the transformation function fromIN
toOUT
.
-
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 aList
of values of typeIN
from aReadableConfig
and transforms it to aList
of typeOUT
based on the providedmapper
function.
-
getAllConfigOptions
public static Set<ConfigOption<?>> getAllConfigOptions(Class<?> configOptionsClass) throws IllegalStateException
- Throws:
IllegalStateException
-
-