@PublicEvolving public class MultipleParameterTool extends AbstractParameterTool
MultipleParameterTool
object is used for
GlobalJobParameters, the last one of multiple values will be used. Navigate to toMap()
for more information.Modifier and Type | Field and Description |
---|---|
protected Map<String,Collection<String>> |
data |
DEFAULT_UNDEFINED, defaultData, NO_VALUE_KEY, unrequestedParameters
Modifier and Type | Method and Description |
---|---|
protected Object |
clone() |
boolean |
equals(Object o) |
static MultipleParameterTool |
fromArgs(String[] args)
Returns
MultipleParameterTool for the given arguments. |
static MultipleParameterTool |
fromMultiMap(Map<String,Collection<String>> multiMap)
Returns
MultipleParameterTool for the given multi map. |
String |
get(String key)
Returns the String value for the given key.
|
Collection<String> |
getMultiParameter(String key)
Returns the Collection of String values for the given key.
|
Collection<String> |
getMultiParameterRequired(String key)
Returns the Collection of String values for the given key.
|
int |
getNumberOfParameters()
Returns number of parameters in
ParameterTool . |
boolean |
has(String value)
Check if value is set.
|
int |
hashCode() |
MultipleParameterTool |
mergeWith(MultipleParameterTool other)
Merges two
MultipleParameterTool . |
Map<String,String> |
toMap()
Convert UserConfig into a
Map<String, String> representation. |
Map<String,Collection<String>> |
toMultiMap()
Return MultiMap of all the parameters processed by
MultipleParameterTool . |
addToDefaults, get, getBoolean, getBoolean, getByte, getByte, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getRequired, getShort, getShort, getUnrequestedParameters
protected final Map<String,Collection<String>> data
public static MultipleParameterTool fromArgs(String[] args)
MultipleParameterTool
for the given arguments. The arguments are keys
followed by values. Keys have to start with '-' or '--'
Example arguments: --key1 value1 --key2 value2 -key3 value3 --multi multiValue1 --multi multiValue2
args
- Input array argumentsMultipleParameterTool
public static MultipleParameterTool fromMultiMap(Map<String,Collection<String>> multiMap)
MultipleParameterTool
for the given multi map.multiMap
- A map of arguments. Key is String and value is a Collection.MultipleParameterTool
public boolean equals(Object o)
equals
in class ExecutionConfig.GlobalJobParameters
public int hashCode()
hashCode
in class ExecutionConfig.GlobalJobParameters
public int getNumberOfParameters()
ParameterTool
.getNumberOfParameters
in class AbstractParameterTool
public String get(String key)
getMultiParameter(String)
instead if want to get multiple values parameter. If the key does
not exist it will return null.get
in class AbstractParameterTool
public boolean has(String value)
has
in class AbstractParameterTool
public Collection<String> getMultiParameter(String key)
public Collection<String> getMultiParameterRequired(String key)
RuntimeException
.public Map<String,Collection<String>> toMultiMap()
MultipleParameterTool
.MultipleParameterTool
. Key is String and Value is a
Collection of String.protected Object clone() throws CloneNotSupportedException
clone
in class AbstractParameterTool
CloneNotSupportedException
public MultipleParameterTool mergeWith(MultipleParameterTool other)
MultipleParameterTool
.other
- Other MultipleParameterTool
objectMultipleParameterTool
public Map<String,String> toMap()
ExecutionConfig.GlobalJobParameters
Map<String, String>
representation. This can be used by
the runtime, for example for presenting the user config in the web frontend.toMap
in class AbstractParameterTool
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.