Example usage for org.apache.commons.cli Option clone

List of usage examples for org.apache.commons.cli Option clone

Introduction

In this page you can find the example usage for org.apache.commons.cli Option clone.

Prototype

public Object clone() 

Source Link

Document

A rather odd clone method - due to incorrect code in 1.0 it is public and in 1.1 rather than throwing a CloneNotSupportedException it throws a RuntimeException so as to maintain backwards compat at the API level.

Usage

From source file:org.finra.dm.core.ArgumentParser.java

/**
 * Adds an option instance. It may be specified as being mandatory.
 *
 * @param option the option that is to be added
 * @param required specifies whether the option being added is mandatory
 *
 * @return the option that was added/*from  www.  j ava2s .  c o m*/
 */
public Option addArgument(Option option, boolean required) {
    optionsIgnoreRequired.addOption((Option) option.clone());

    option.setRequired(required);
    options.addOption(option);

    return option;
}