Package org.rossonet.ext.picocli
Interface CommandLine.Model.ITypeInfo
-
- Enclosing class:
- CommandLine.Model
public static interface CommandLine.Model.ITypeInfoEncapculates type information for an option or parameter to make this information available both at runtime and at compile time (whenClassvalues are not available). Most of the methods in this interface (but not all!) are safe to use by annotation processors.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.booleanisArray()Returnstrueif this type is an array multi-value type.booleanisBoolean()booleanisCollection()booleanisEnum()ReturnstrueifgetType()is an enum.booleanisMap()booleanisMultiValue()ReturnstrueifgetType()is an array, map or collection.booleanisOptional()
-
-
-
Method Detail
-
getActualGenericTypeArguments
java.util.List<java.lang.String> getActualGenericTypeArguments()
Returns the names of the type arguments if this is a generic type. For example, returns["java.lang.String"]if this type isList<String>.
-
getAuxiliaryTypeInfos
java.util.List<CommandLine.Model.ITypeInfo> getAuxiliaryTypeInfos()
Returns type information of components or elements of amultivaluetype.
-
getAuxiliaryTypes
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. This method is not safe for annotation processors to use.- Returns:
- the component type or types of an array, Collection or Map type
-
getClassName
java.lang.String getClassName()
-
getClassSimpleName
java.lang.String getClassSimpleName()
-
getEnumConstantNames
java.util.List<java.lang.String> getEnumConstantNames()
-
getType
java.lang.Class<?> getType()
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.- Returns:
- the class that the option or parameter value should be converted to
-
isArray
boolean isArray()
Returnstrueif 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.
-
isBoolean
boolean isBoolean()
-
isCollection
boolean isCollection()
-
isEnum
boolean isEnum()
ReturnstrueifgetType()is an enum.
-
isMap
boolean isMap()
-
isMultiValue
boolean isMultiValue()
ReturnstrueifgetType()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.
-
isOptional
boolean isOptional()
- Since:
- 4.6
-
-