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
Construct this object using givenattrs.- Parameters:
attrs- The attributes
-
-
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
Returns attribute asBytewith given attribute namedest.- Parameters:
dest- The attribute name- Returns:
- The attribute value casted to
Byte, ornullif it is not found.
-
getShort
Returns attribute asShortwith given attribute namedest.- Parameters:
dest- The attribute name- Returns:
- The attribute value casted to
Short, ornullif it is not found.
-
getInt
Returns attribute asIntegerwith given attribute namedest.- Parameters:
dest- The attribute name- Returns:
- The attribute value casted to
Integer, ornullif it is not found.
-
getLong
Returns attribute asLongwith given attribute namedest.- Parameters:
dest- The attribute name- Returns:
- The attribute value casted to
Long, ornullif it is not found.
-
getFloat
Returns attribute asFloatwith given attribute namedest.- Parameters:
dest- The attribute name- Returns:
- The attribute value casted to
Float, ornullif it is not found.
-
getDouble
Returns attribute asDoublewith given attribute namedest.- Parameters:
dest- The attribute name- Returns:
- The attribute value casted to
Double, ornullif it is not found.
-
getBoolean
Returns attribute asBooleanwith given attribute namedest.- Parameters:
dest- The attribute name- Returns:
- The attribute value casted to
Boolean, ornullif it is not found.
-
getList
Returns attribute asListwith given attribute namedest.- Type Parameters:
E- The type of the list elements- Parameters:
dest- The attribute name- Returns:
- The attribute value casted to
List, ornullif it is not found.
-
getAttrs
Returns
Mapobject holding attribute values.The application code can freely use returned object.
- Returns:
Mapobject holding attribute values.
-
toString
-