public class FlagType extends BaseValueType<Boolean>
This would be used to parse a command line argument that is true by its presence, e.g.:
java MyClass launch
If launch is an AndHow property using the FlagType (i.e. FlagProp), launch will
be considered true just by its presence.
This class is threadsafe and uses a singleton pattern to prevent multiple instances since all users can safely use the same instance.
clazzType| Modifier and Type | Method and Description |
|---|---|
Boolean |
cast(Object o)
Attempt to cast the passed object to the generic type T.
|
static FlagType |
get()
Deprecated.
since 0.4.1. Use
instance() instead |
static FlagType |
instance() |
Boolean |
parse(String sourceValue)
Attempts to parse the passed String into the destinationType.
|
getDestinationType, isParsable, toString@Deprecated public static FlagType get()
instance() insteadFlagType()public static FlagType instance()
FlagType()public Boolean parse(String sourceValue) throws IllegalArgumentException
ValueTypeIllegalArgumentExceptionpublic Boolean cast(Object o) throws RuntimeException
ValueTypeRuntimeExceptionCopyright © 2021. All rights reserved.