V
- the type of the param value@PublicEvolving public class ParamInfo<V> extends Object
A parameter can either be optional or non-optional.
Please see Params.get(ParamInfo)
and Params.contains(ParamInfo)
for more details about the behavior.
A parameter may have aliases in addition to the parameter name for convenience and compatibility purposes. One should not set values for both parameter name and an alias. One and only one value should be set either under the parameter name or one of the alias.
Modifier and Type | Method and Description |
---|---|
String[] |
getAlias()
Returns the aliases of the parameter.
|
V |
getDefaultValue()
Returns the default value of the parameter.
|
String |
getDescription()
Returns the description of the parameter.
|
String |
getName()
Returns the name of the parameter.
|
ParamValidator<V> |
getValidator()
Returns the validator to validate the value of the parameter.
|
Class<V> |
getValueClass()
Returns the class of the param value.
|
boolean |
hasDefaultValue()
Returns whether the parameter has a default value.
|
boolean |
isOptional()
Returns whether the parameter is optional.
|
public String getName()
public String[] getAlias()
public String getDescription()
public boolean isOptional()
true
if the param is optional, false
otherwisepublic boolean hasDefaultValue()
null
may also be a valid
default value of a parameter, the return of getDefaultValue may be null
even when
this method returns true.true
if the param is has a default value(even if it's a null
), false
otherwisepublic V getDefaultValue()
null
even if hasDefaultValue returns true.null
if not definedpublic ParamValidator<V> getValidator()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.