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.ITypeInfocreate(Class<?> type, Class<?>[] annotationTypes, Type genericType, CommandLine.Range arity, Class<?> defaultType, boolean interactive) static CommandLine.Model.ITypeInfocreate(Class<?> type, Class<?>[] auxiliaryTypes, List<String> actualGenericTypeArguments, CommandLine.Range arity, Class<?> defaultType, boolean interactive) (package private) static CommandLine.Model.ITypeInfocreateForAuxType(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 amultivaluetype.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.inthashCode()(package private) static Class<?>[]inferTypes(Class<?> propertyType, Class<?>[] annotationTypes, Type genericType) booleanisArray()Returnstrueif this type is an array multi-value type.booleanbooleanbooleanisEnum()ReturnstrueifCommandLine.Model.ITypeInfo.getType()is an enum.booleanisMap()booleanReturnstrueifCommandLine.Model.ITypeInfo.getType()is an array, map or collection.booleantoString()
-
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:
isBooleanin interfaceCommandLine.Model.ITypeInfo
-
isMultiValue
public boolean isMultiValue()Description copied from interface:CommandLine.Model.ITypeInfoReturnstrueifCommandLine.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:
isMultiValuein interfaceCommandLine.Model.ITypeInfo
-
isArray
public boolean isArray()Description copied from interface:CommandLine.Model.ITypeInfoReturnstrueif 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:
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
- Specified by:
getClassNamein interfaceCommandLine.Model.ITypeInfo
-
getClassSimpleName
- Specified by:
getClassSimpleNamein interfaceCommandLine.Model.ITypeInfo
-
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
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
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
Description copied from interface:CommandLine.Model.ITypeInfoReturns type information of components or elements of amultivaluetype.- Specified by:
getAuxiliaryTypeInfosin interfaceCommandLine.Model.ITypeInfo
-
getEnumConstantNames
- Specified by:
getEnumConstantNamesin interfaceCommandLine.Model.ITypeInfo
-
equals
-
hashCode
public int hashCode() -
toString
-