congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MultipleArgumentsForOptionException
Code IndexAdd Tabnine to your IDE (free)

How to use
MultipleArgumentsForOptionException
in
joptsimple

Best Java code snippets using joptsimple.MultipleArgumentsForOptionException (Showing top 12 results out of 315)

origin: io.snappydata/gemfire-util

  @Override
  public String getMessage() {
    return "Found multiple arguments for option " + multipleOptionMessage() + ", but you asked for only one";
  }
}
origin: net.sf.jopt-simple/jopt-simple

  @Override
  Object[] messageArguments() {
    return new Object[] { singleOptionString() };
  }
}
origin: net.sf.jopt-simple/jopt-simple

/**
 * Gives the argument associated with the given option.
 *
 * <p>This method recognizes only instances of options returned from the fluent interface methods.</p>
 *
 * @param <V> represents the type of the arguments the given option accepts
 * @param option the option to search for
 * @return the argument of the given option; {@code null} if no argument is present, or that option was not
 * detected
 * @throws OptionException if more than one argument was detected for the option
 * @throws NullPointerException if {@code option} is {@code null}
 * @throws ClassCastException if the arguments of this option are not of the expected type
 */
public <V> V valueOf( OptionSpec<V> option ) {
  requireNonNull( option );
  List<V> values = valuesOf( option );
  switch ( values.size() ) {
    case 0:
      return null;
    case 1:
      return values.get( 0 );
    default:
      throw new MultipleArgumentsForOptionException( option );
  }
}
origin: jopt-simple/jopt-simple

/**
 * Gives the argument associated with the given option.
 *
 * <p>This method recognizes only instances of options returned from the fluent interface methods.</p>
 *
 * @param <V> represents the type of the arguments the given option accepts
 * @param option the option to search for
 * @return the argument of the given option; {@code null} if no argument is present, or that option was not
 * detected
 * @throws OptionException if more than one argument was detected for the option
 * @throws NullPointerException if {@code option} is {@code null}
 * @throws ClassCastException if the arguments of this option are not of the expected type
 */
public <V> V valueOf( OptionSpec<V> option ) {
  requireNonNull( option );
  List<V> values = valuesOf( option );
  switch ( values.size() ) {
    case 0:
      return null;
    case 1:
      return values.get( 0 );
    default:
      throw new MultipleArgumentsForOptionException( option );
  }
}
origin: io.snappydata/gemfire-joptsimple

/**
 * Gives the argument associated with the given option.
 *
 * <p>This method recognizes only instances of options returned from the fluent interface methods.</p>
 *
 * @param <V> represents the type of the arguments the given option accepts
 * @param option the option to search for
 * @return the argument of the given option; {@code null} if no argument is present, or that option was not
 * detected
 * @throws OptionException if more than one argument was detected for the option
 * @throws NullPointerException if {@code option} is {@code null}
 * @throws ClassCastException if the arguments of this option are not of the expected type
 */
public <V> V valueOf( OptionSpec<V> option ) {
  ensureNotNull( option );
  List<V> values = valuesOf( option );
  switch ( values.size() ) {
    case 0:
      return null;
    case 1:
      return values.get( 0 );
    default:
      throw new MultipleArgumentsForOptionException( option.options() );
  }
}
origin: org.apache.geode/geode-joptsimple

  @Override
  public String getMessage() {
    return "Found multiple arguments for option " + multipleOptionMessage() + ", but you asked for only one";
  }
}
origin: jopt-simple/jopt-simple

  @Override
  Object[] messageArguments() {
    return new Object[] { singleOptionString() };
  }
}
origin: io.snappydata/gemfire-util

/**
 * Gives the argument associated with the given option.
 *
 * <p>This method recognizes only instances of options returned from the fluent interface methods.</p>
 *
 * @param <V> represents the type of the arguments the given option accepts
 * @param option the option to search for
 * @return the argument of the given option; {@code null} if no argument is present, or that option was not
 * detected
 * @throws OptionException if more than one argument was detected for the option
 * @throws NullPointerException if {@code option} is {@code null}
 * @throws ClassCastException if the arguments of this option are not of the expected type
 */
public <V> V valueOf( OptionSpec<V> option ) {
  ensureNotNull( option );
  List<V> values = valuesOf( option );
  switch ( values.size() ) {
    case 0:
      return null;
    case 1:
      return values.get( 0 );
    default:
      throw new MultipleArgumentsForOptionException( option.options() );
  }
}
origin: io.snappydata/gemfire-joptsimple

  @Override
  public String getMessage() {
    return "Found multiple arguments for option " + multipleOptionMessage() + ", but you asked for only one";
  }
}
origin: org.apache.geode/geode-joptsimple

/**
 * Gives the argument associated with the given option.
 *
 * <p>This method recognizes only instances of options returned from the fluent interface methods.</p>
 *
 * @param <V> represents the type of the arguments the given option accepts
 * @param option the option to search for
 * @return the argument of the given option; {@code null} if no argument is present, or that option was not
 * detected
 * @throws OptionException if more than one argument was detected for the option
 * @throws NullPointerException if {@code option} is {@code null}
 * @throws ClassCastException if the arguments of this option are not of the expected type
 */
public <V> V valueOf( OptionSpec<V> option ) {
  ensureNotNull( option );
  List<V> values = valuesOf( option );
  switch ( values.size() ) {
    case 0:
      return null;
    case 1:
      return values.get( 0 );
    default:
      throw new MultipleArgumentsForOptionException( option.options() );
  }
}
origin: org.apache.geode/gemfire-core

 List<String> optionList = new ArrayList<String>(1);
 optionList.add(string);
 ce = processException(new MultipleArgumentsForOptionException(optionList, joptOptionSet));
} else if ((arguments.size() == 1 && !(option.getConverter() instanceof MultipleValueConverter)) || option.getValueSeparator() == null) {
 optionSet.put(option, arguments.get(0).toString().trim());
origin: io.snappydata/gemfire-core

 List<String> optionList = new ArrayList<String>(1);
 optionList.add(string);
 ce = processException(new MultipleArgumentsForOptionException(optionList, joptOptionSet));
} else if ((arguments.size() == 1 && !(option.getConverter() instanceof MultipleValueConverter)) || option.getValueSeparator() == null) {
 optionSet.put(option, arguments.get(0).toString().trim());
joptsimpleMultipleArgumentsForOptionException

Javadoc

Thrown when asking an OptionSet for a single argument of an option when many have been specified.

Most used methods

  • <init>
  • multipleOptionMessage
  • singleOptionString

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Permission (java.security)
    Legacy security code; do not use.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now