MCPcopy
hub / github.com/remkop/picocli / toCommandLine

Method toCommandLine

src/main/java/picocli/CommandLine.java:3639–3639  ·  view source on GitHub ↗
(Object obj, IFactory factory)

Source from the content-addressed store, hash-verified

3637 private static boolean isBoolean(Class<?>[] types) { return isBoolean(types[0]) || (isOptional(types[0]) && isBoolean(types[1])); }
3638 private static boolean isBoolean(Class<?> type) { return type == Boolean.class || type == Boolean.TYPE; }
3639 private static CommandLine toCommandLine(Object obj, IFactory factory) { return obj instanceof CommandLine ? (CommandLine) obj : new CommandLine(obj, factory, false);}
3640 private static boolean isMultiValue(Class<?> cls) { return (cls.isArray() && cls != char[].class) || Collection.class.isAssignableFrom(cls) || Map.class.isAssignableFrom(cls); }
3641 private static boolean isOptional(Class<?> cls) { return cls != null && "java.util.Optional".equals(cls.getName()); } // #1108
3642 private static Object getOptionalEmpty() throws Exception {

Callers 5

addSubcommandMethod · 0.95
populateCommandMethod · 0.95
populateSpecMethod · 0.95
usageMethod · 0.95
initSubcommandsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected