Codota Logo
MultipleArgumentsForOptionException
Code IndexAdd Codota to your IDE (free)

How to use
MultipleArgumentsForOptionException
in
joptsimple

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

  • Common ways to obtain MultipleArgumentsForOptionException
private void myMethod () {
MultipleArgumentsForOptionException m =
  • Codota IconOptionSpec optionSpec;new MultipleArgumentsForOptionException(optionSpec.options())
  • Smart code suggestions by Codota
}
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

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now