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>actualGenericTypeArgumentsprivate java.lang.Class<?>[]auxiliaryTypes(package private) static java.lang.StringERRORMSGprivate 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.ITypeInfocreate(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.ITypeInfocreate(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.ITypeInfocreateForAuxType(java.lang.Class<?> type)booleanequals(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 amultivaluetype.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.StringgetClassName()java.lang.StringgetClassSimpleName()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.inthashCode()(package private) static java.lang.Class<?>[]inferTypes(java.lang.Class<?> propertyType, java.lang.Class<?>[] annotationTypes, java.lang.reflect.Type genericType)booleanisArray()booleanisBoolean()booleanisCollection()booleanisEnum()ReturnstrueifCommandLine.Model.ITypeInfo.getType()is an enum.booleanisMap()booleanisMultiValue()ReturnstrueifCommandLine.Model.ITypeInfo.getType()is an array, map or collection.booleanisOptional()java.lang.StringtoString()
-
-
-
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:
isBooleanin interfaceCommandLine.Model.ITypeInfo
-
isMultiValue
public boolean isMultiValue()
Description copied from interface:CommandLine.Model.ITypeInfoReturnstrueifCommandLine.Model.ITypeInfo.getType()is an array, map or collection.- Specified by:
isMultiValuein interfaceCommandLine.Model.ITypeInfo
-
isArray
public boolean isArray()
- Specified by:
isArrayin interfaceCommandLine.Model.ITypeInfo
-
isCollection
public boolean isCollection()
- Specified by:
isCollectionin interfaceCommandLine.Model.ITypeInfo
-
isMap
public boolean isMap()
- Specified by:
isMapin interfaceCommandLine.Model.ITypeInfo
-
isOptional
public boolean isOptional()
Description copied from interface:CommandLine.Model.ITypeInfo- Specified by:
isOptionalin interfaceCommandLine.Model.ITypeInfo
-
isEnum
public boolean isEnum()
Description copied from interface:CommandLine.Model.ITypeInfoReturnstrueifCommandLine.Model.ITypeInfo.getType()is an enum.- Specified by:
isEnumin interfaceCommandLine.Model.ITypeInfo
-
getClassName
public java.lang.String getClassName()
- Specified by:
getClassNamein interfaceCommandLine.Model.ITypeInfo
-
getClassSimpleName
public java.lang.String getClassSimpleName()
- Specified by:
getClassSimpleNamein interfaceCommandLine.Model.ITypeInfo
-
getType
public java.lang.Class<?> getType()
Description copied from interface:CommandLine.Model.ITypeInfoReturns 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:
getTypein 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.ITypeInfoReturns 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:
getAuxiliaryTypesin 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.ITypeInfoReturns 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:
getActualGenericTypeArgumentsin interfaceCommandLine.Model.ITypeInfo
-
getAuxiliaryTypeInfos
public java.util.List<CommandLine.Model.ITypeInfo> getAuxiliaryTypeInfos()
Description copied from interface:CommandLine.Model.ITypeInfoReturns type information of components or elements of amultivaluetype.- Specified by:
getAuxiliaryTypeInfosin interfaceCommandLine.Model.ITypeInfo
-
getEnumConstantNames
public java.util.List<java.lang.String> getEnumConstantNames()
- Specified by:
getEnumConstantNamesin interfaceCommandLine.Model.ITypeInfo
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-