MCPcopy Create free account
hub / github.com/cbeust/jcommander / addObject

Method addObject

src/main/java/com/beust/jcommander/JCommander.java:317–330  ·  view source on GitHub ↗
(Object object)

Source from the content-addressed store, hash-verified

315 */
316 // declared final since this is invoked from constructors
317 public final void addObject(Object object) {
318 if (object instanceof Iterable i) {
319 // Iterable
320 i.forEach(objects::add);
321 } else if (object.getClass().isArray()) {
322 // Array
323 for (Object o : (Object[]) object) {
324 objects.add(o);
325 }
326 } else {
327 // Single object
328 objects.add(object);
329 }
330 }
331
332 /**
333 * Sets the {@link ResourceBundle} to use for looking up descriptions.

Callers 15

partialValidationMethod · 0.95
JCommanderMethod · 0.95
addCommandMethod · 0.95
mainMethod · 0.45
simpleArgsMethod · 0.45
repeatedArgsMethod · 0.45
requiredFields1FailMethod · 0.45
multipleNamesMethod · 0.45
i18n2Method · 0.45

Calls

no outgoing calls

Tested by 15

partialValidationMethod · 0.76
mainMethod · 0.36
simpleArgsMethod · 0.36
repeatedArgsMethod · 0.36
requiredFields1FailMethod · 0.36
multipleNamesMethod · 0.36
i18n2Method · 0.36
multiObjectsMethod · 0.36