Class Namespace
java.lang.Object
net.sourceforge.argparse4j.inf.Namespace
This class holds attributes added by
ArgumentParser.parseArgs(String[]).
It is just a wrapper of Map object which stores actual attributes.
Map object can be retrieved using getAttrs(). This class
provides several shortcut methods to get attribute values.
toString() provides nice textual representation of stored
attributes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TReturns attribute with given attribute namedest.getAttrs()ReturnsMapobject holding attribute values.getBoolean(String dest) Returns attribute asBooleanwith given attribute namedest.Returns attribute asBytewith given attribute namedest.Returns attribute asDoublewith given attribute namedest.Returns attribute asFloatwith given attribute namedest.Returns attribute asIntegerwith given attribute namedest.<E> List<E> Returns attribute asListwith given attribute namedest.Returns attribute asLongwith given attribute namedest.Returns attribute asShortwith given attribute namedest.Returns attribute asStringwith given attribute namedest.toString()
-
Field Details
-
attrs_
-
-
Constructor Details
-
Namespace
-
-
Method Details
-
get
Returns attribute with given attribute namedest.- Type Parameters:
T- The type of the attribute value- Parameters:
dest- The attribute name- Returns:
- The attribute value, or
nullif it is not found.
-
getString
Returns attribute asStringwith given attribute namedest. This method callsObject.toString()method of a found object to get string representation unless object isnull.- Parameters:
dest- The attribute name- Returns:
- The attribute value casted to
String, ornullif is not found.
-
getByte
-
getShort
-
getInt
-
getLong
-
getFloat
-
getDouble
-
getBoolean
-
getList
-
getAttrs
-
toString
-