Package picocli
Class CommandLine.Model.RuntimeTypeInfo
java.lang.Object
picocli.CommandLine.Model.RuntimeTypeInfo
- All Implemented Interfaces:
CommandLine.Model.ITypeInfo
- Enclosing class:
CommandLine.Model
static class CommandLine.Model.RuntimeTypeInfo
extends Object
implements CommandLine.Model.ITypeInfo
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRuntimeTypeInfo
(Class<?> type, Class<?>[] auxiliaryTypes, List<String> actualGenericTypeArguments) -
Method Summary
Modifier and TypeMethodDescriptionstatic CommandLine.Model.ITypeInfo
create
(Class<?> type, Class<?>[] annotationTypes, Type genericType, CommandLine.Range arity, Class<?> defaultType, boolean interactive) static CommandLine.Model.ITypeInfo
create
(Class<?> type, Class<?>[] auxiliaryTypes, List<String> actualGenericTypeArguments, CommandLine.Range arity, Class<?> defaultType, boolean interactive) (package private) static CommandLine.Model.ITypeInfo
createForAuxType
(Class<?> type) boolean
(package private) static Class<?>[]
extractTypeParameters
(ParameterizedType genericType) Returns the names of the type arguments if this is a generic type.Returns type information of components or elements of amultivalue
type.Class<?>[]
Returns the component class of an array, or the parameter type of a generic Collection, or the parameter types of the key and the value of a generic Map.Class
<?> getType()
Returns the class that the option or parameter value should be converted to when matched on the command line.int
hashCode()
(package private) static Class<?>[]
inferTypes
(Class<?> propertyType, Class<?>[] annotationTypes, Type genericType) boolean
isArray()
Returnstrue
if this type is an array multi-value type.boolean
boolean
boolean
isEnum()
Returnstrue
ifCommandLine.Model.ITypeInfo.getType()
is an enum.boolean
isMap()
boolean
Returnstrue
ifCommandLine.Model.ITypeInfo.getType()
is an array, map or collection.boolean
toString()
-
Field Details
-
ERRORMSG
- See Also:
-
type
-
auxiliaryTypes
-
actualGenericTypeArguments
-
-
Constructor Details
-
RuntimeTypeInfo
-
-
Method Details
-
createForAuxType
-
create
public static CommandLine.Model.ITypeInfo create(Class<?> type, Class<?>[] annotationTypes, Type genericType, CommandLine.Range arity, Class<?> defaultType, boolean interactive) -
create
public static CommandLine.Model.ITypeInfo create(Class<?> type, Class<?>[] auxiliaryTypes, List<String> actualGenericTypeArguments, CommandLine.Range arity, Class<?> defaultType, boolean interactive) -
inferTypes
-
extractTypeParameters
-
isBoolean
public boolean isBoolean()Description copied from interface:CommandLine.Model.ITypeInfo
- Specified by:
isBoolean
in interfaceCommandLine.Model.ITypeInfo
-
isMultiValue
public boolean isMultiValue()Description copied from interface:CommandLine.Model.ITypeInfo
Returnstrue
ifCommandLine.Model.ITypeInfo.getType()
is an array, map or collection. Note that from picocli 4.7,char[]
arrays are considered single values (similar to String) and are not treated as arrays.- Specified by:
isMultiValue
in interfaceCommandLine.Model.ITypeInfo
-
isArray
public boolean isArray()Description copied from interface:CommandLine.Model.ITypeInfo
Returnstrue
if this type is an array multi-value type. Note that from picocli 4.7,char[]
arrays are considered single values (similar to String) and are not treated as arrays.- Specified by:
isArray
in interfaceCommandLine.Model.ITypeInfo
-
isCollection
public boolean isCollection()- Specified by:
isCollection
in interfaceCommandLine.Model.ITypeInfo
-
isMap
public boolean isMap()- Specified by:
isMap
in interfaceCommandLine.Model.ITypeInfo
-
isOptional
public boolean isOptional()Description copied from interface:CommandLine.Model.ITypeInfo
- Specified by:
isOptional
in interfaceCommandLine.Model.ITypeInfo
-
isEnum
public boolean isEnum()Description copied from interface:CommandLine.Model.ITypeInfo
Returnstrue
ifCommandLine.Model.ITypeInfo.getType()
is an enum.- Specified by:
isEnum
in interfaceCommandLine.Model.ITypeInfo
-
getClassName
- Specified by:
getClassName
in interfaceCommandLine.Model.ITypeInfo
-
getClassSimpleName
- Specified by:
getClassSimpleName
in interfaceCommandLine.Model.ITypeInfo
-
getType
Description copied from interface:CommandLine.Model.ITypeInfo
Returns the class that the option or parameter value should be converted to when matched on the command line. This method is not safe for annotation processors to use.- Specified by:
getType
in interfaceCommandLine.Model.ITypeInfo
- Returns:
- the class that the option or parameter value should be converted to
-
getAuxiliaryTypes
Description copied from interface:CommandLine.Model.ITypeInfo
Returns the component class of an array, or the parameter type of a generic Collection, or the parameter types of the key and the value of a generic Map. This method is not safe for annotation processors to use.- Specified by:
getAuxiliaryTypes
in interfaceCommandLine.Model.ITypeInfo
- Returns:
- the component type or types of an array, Collection or Map type
-
getActualGenericTypeArguments
Description copied from interface:CommandLine.Model.ITypeInfo
Returns the names of the type arguments if this is a generic type. For example, returns["java.lang.String"]
if this type isList<String>
.- Specified by:
getActualGenericTypeArguments
in interfaceCommandLine.Model.ITypeInfo
-
getAuxiliaryTypeInfos
Description copied from interface:CommandLine.Model.ITypeInfo
Returns type information of components or elements of amultivalue
type.- Specified by:
getAuxiliaryTypeInfos
in interfaceCommandLine.Model.ITypeInfo
-
getEnumConstantNames
- Specified by:
getEnumConstantNames
in interfaceCommandLine.Model.ITypeInfo
-
equals
-
hashCode
public int hashCode() -
toString
-