Package top.focess.util.option
Class Option
- java.lang.Object
-
- top.focess.util.option.Option
-
public class Option extends Object
An option is a way to present arguments. It is convenient to use option to get arguments that we want.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOption(OptionParserClassifier classifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tget(OptionType<T> optionType)Get argument by the option typeStringgetName()Get the name of the optionprotected voidput(OptionType<?> optionType, String value)StringtoString()
-
-
-
Constructor Detail
-
Option
protected Option(OptionParserClassifier classifier)
-
-
Method Detail
-
getName
public String getName()
Get the name of the option- Returns:
- the name of the option
-
put
protected void put(OptionType<?> optionType, String value)
-
get
public <T> T get(OptionType<T> optionType)
Get argument by the option type- Type Parameters:
T- the target type- Parameters:
optionType- the option type- Returns:
- the argument in the target type
-
-