Modifier and Type | Method and Description |
---|---|
static <IN,OUT,E extends Throwable> |
decodeListFromConfig(ReadableConfig configuration,
ConfigOption<List<IN>> key,
FunctionWithException<IN,OUT,E> mapper)
Gets a
List of values of type IN from a ReadableConfig and transforms
it to a List of type OUT based on the provided mapper function. |
static <IN,OUT> void |
encodeArrayToConfig(WritableConfig configuration,
ConfigOption<List<OUT>> key,
IN[] values,
java.util.function.Function<IN,OUT> mapper)
|
static <IN,OUT> void |
encodeCollectionToConfig(WritableConfig configuration,
ConfigOption<List<OUT>> key,
Collection<IN> values,
java.util.function.Function<IN,OUT> mapper)
Puts a
Collection of values of type IN in a WritableConfig as a
ConfigOption of type List of type OUT . |
public static <IN,OUT> void encodeArrayToConfig(WritableConfig configuration, ConfigOption<List<OUT>> key, @Nullable IN[] values, java.util.function.Function<IN,OUT> mapper)
IN
in a WritableConfig
as a ConfigOption
of type List
of type OUT
. If the values
is null
or empty, then nothing is put in the configuration.configuration
- the configuration object to put the list inkey
- the option
to serve as the key for the list in the
configurationvalues
- the array of values to put as value for the key
mapper
- the transformation function from IN
to OUT
.public static <IN,OUT> void encodeCollectionToConfig(WritableConfig configuration, ConfigOption<List<OUT>> key, @Nullable Collection<IN> values, java.util.function.Function<IN,OUT> mapper)
Collection
of values of type IN
in a WritableConfig
as a
ConfigOption
of type List
of type OUT
. If the values
is
null
or empty, then nothing is put in the configuration.configuration
- the configuration object to put the list inkey
- the option
to serve as the key for the list in the
configurationvalues
- the collection of values to put as value for the key
mapper
- the transformation function from IN
to OUT
.public static <IN,OUT,E extends Throwable> List<OUT> decodeListFromConfig(ReadableConfig configuration, ConfigOption<List<IN>> key, FunctionWithException<IN,OUT,E> mapper) throws E extends Throwable
List
of values of type IN
from a ReadableConfig
and transforms
it to a List
of type OUT
based on the provided mapper
function.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.