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 java.lang.Object implements CommandLine.Model.ITypeInfo
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>
actualGenericTypeArguments
private java.lang.Class<?>[]
auxiliaryTypes
(package private) static java.lang.String
ERRORMSG
private java.lang.Class<?>
type
-
Constructor Summary
Constructors Constructor Description RuntimeTypeInfo(java.lang.Class<?> type, java.lang.Class<?>[] auxiliaryTypes, java.util.List<java.lang.String> actualGenericTypeArguments)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CommandLine.Model.ITypeInfo
create(java.lang.Class<?> type, java.lang.Class<?>[] annotationTypes, java.lang.reflect.Type genericType, CommandLine.Range arity, java.lang.Class<?> defaultType, boolean interactive)
static CommandLine.Model.ITypeInfo
create(java.lang.Class<?> type, java.lang.Class<?>[] auxiliaryTypes, java.util.List<java.lang.String> actualGenericTypeArguments, CommandLine.Range arity, java.lang.Class<?> defaultType, boolean interactive)
(package private) static CommandLine.Model.ITypeInfo
createForAuxType(java.lang.Class<?> type)
boolean
equals(java.lang.Object obj)
(package private) static java.lang.Class<?>[]
extractTypeParameters(java.lang.reflect.ParameterizedType genericType)
java.util.List<java.lang.String>
getActualGenericTypeArguments()
Returns the names of the type arguments if this is a generic type.java.util.List<CommandLine.Model.ITypeInfo>
getAuxiliaryTypeInfos()
Returns type information of components or elements of amultivalue
type.java.lang.Class<?>[]
getAuxiliaryTypes()
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.java.lang.String
getClassName()
java.lang.String
getClassSimpleName()
java.util.List<java.lang.String>
getEnumConstantNames()
java.lang.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 java.lang.Class<?>[]
inferTypes(java.lang.Class<?> propertyType, java.lang.Class<?>[] annotationTypes, java.lang.reflect.Type genericType)
boolean
isArray()
boolean
isBoolean()
boolean
isCollection()
boolean
isEnum()
Returnstrue
ifCommandLine.Model.ITypeInfo.getType()
is an enum.boolean
isMap()
boolean
isMultiValue()
Returnstrue
ifCommandLine.Model.ITypeInfo.getType()
is an array, map or collection.boolean
isOptional()
java.lang.String
toString()
-
-
-
Field Detail
-
ERRORMSG
static final java.lang.String ERRORMSG
- See Also:
- Constant Field Values
-
type
private final java.lang.Class<?> type
-
auxiliaryTypes
private final java.lang.Class<?>[] auxiliaryTypes
-
actualGenericTypeArguments
private final java.util.List<java.lang.String> actualGenericTypeArguments
-
-
Method Detail
-
createForAuxType
static CommandLine.Model.ITypeInfo createForAuxType(java.lang.Class<?> type)
-
create
public static CommandLine.Model.ITypeInfo create(java.lang.Class<?> type, java.lang.Class<?>[] annotationTypes, java.lang.reflect.Type genericType, CommandLine.Range arity, java.lang.Class<?> defaultType, boolean interactive)
-
create
public static CommandLine.Model.ITypeInfo create(java.lang.Class<?> type, java.lang.Class<?>[] auxiliaryTypes, java.util.List<java.lang.String> actualGenericTypeArguments, CommandLine.Range arity, java.lang.Class<?> defaultType, boolean interactive)
-
inferTypes
static java.lang.Class<?>[] inferTypes(java.lang.Class<?> propertyType, java.lang.Class<?>[] annotationTypes, java.lang.reflect.Type genericType)
-
extractTypeParameters
static java.lang.Class<?>[] extractTypeParameters(java.lang.reflect.ParameterizedType genericType)
-
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.- Specified by:
isMultiValue
in interfaceCommandLine.Model.ITypeInfo
-
isArray
public boolean isArray()
- 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
public java.lang.String getClassName()
- Specified by:
getClassName
in interfaceCommandLine.Model.ITypeInfo
-
getClassSimpleName
public java.lang.String getClassSimpleName()
- Specified by:
getClassSimpleName
in interfaceCommandLine.Model.ITypeInfo
-
getType
public java.lang.Class<?> 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
public java.lang.Class<?>[] 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
public java.util.List<java.lang.String> 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
public java.util.List<CommandLine.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
public java.util.List<java.lang.String> getEnumConstantNames()
- Specified by:
getEnumConstantNames
in interfaceCommandLine.Model.ITypeInfo
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-