Package coneforest.cli
Class Option
- java.lang.Object
-
- coneforest.cli.Option
-
- Direct Known Subclasses:
OptionWithArg
,OptionWithoutArg
public abstract class Option extends Object
Base class representing an abstract option.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <T> T
getValue()
Abstract method for fetching an option value.boolean
hasName(String name)
Returns true if given name is found among option names, and false otherwise.
-
-
-
Constructor Detail
-
Option
public Option(String names)
Constructs an option object with given names.- Parameters:
names
- option names.
-
-
Method Detail
-
getValue
public abstract <T> T getValue()
Abstract method for fetching an option value.- Type Parameters:
T
- a type of a value.- Returns:
- a value.
-
hasName
public boolean hasName(String name)
Returns true if given name is found among option names, and false otherwise.- Parameters:
name
- a name.- Returns:
- a result.
-
-