Assert.assertTrue(workingStack.isEmpty(), "Working stack should be empty but was " + new ArrayList<String>(workingStack));
protected boolean equalsImpl(ArgSpec other) { boolean result = Assert.equals(this.defaultValue, other.defaultValue) && Assert.equals(this.arity, other.arity) && Assert.equals(this.hidden, other.hidden) && Assert.equals(this.paramLabel, other.paramLabel) && Assert.equals(this.hideParamSyntax, other.hideParamSyntax) && Assert.equals(this.required, other.required) && Assert.equals(this.splitRegex, other.splitRegex) && Arrays.equals(this.description, other.description) && Assert.equals(this.descriptionKey, other.descriptionKey) && this.typeInfo.equals(other.typeInfo) ; return result; } protected int hashCodeImpl() {
protected int hashCodeImpl() { return 17 + 37 * Assert.hashCode(defaultValue) + 37 * Assert.hashCode(arity) + 37 * Assert.hashCode(hidden) + 37 * Assert.hashCode(paramLabel) + 37 * Assert.hashCode(hideParamSyntax) + 37 * Assert.hashCode(required) + 37 * Assert.hashCode(splitRegex) + 37 * Arrays.hashCode(description) + 37 * Assert.hashCode(descriptionKey) + 37 * typeInfo.hashCode() ; }
Assert.assertTrue(workingStack.isEmpty(), "Working stack should be empty but was " + new ArrayList<String>(workingStack));
protected boolean equalsImpl(ArgSpec other) { boolean result = Assert.equals(this.defaultValue, other.defaultValue) && Assert.equals(this.type, other.type) && Assert.equals(this.arity, other.arity) && Assert.equals(this.hidden, other.hidden) && Assert.equals(this.paramLabel, other.paramLabel) && Assert.equals(this.hideParamSyntax, other.hideParamSyntax) && Assert.equals(this.required, other.required) && Assert.equals(this.splitRegex, other.splitRegex) && Arrays.equals(this.description, other.description) && Assert.equals(this.descriptionKey, other.descriptionKey) && Arrays.equals(this.auxiliaryTypes, other.auxiliaryTypes) ; return result; } protected int hashCodeImpl() {
ProxyBinding(Method method) { this.method = Assert.notNull(method, "method"); } @SuppressWarnings("unchecked") public <T> T get() { return (T) map.get(method.getName()); }
private Builder(CommandSpec spec) { commandSpec = Assert.notNull(spec, "commandSpec"); } /** Creates and returns a new {@code ParseResult} instance for this builder's configuration. */
protected int hashCodeImpl() { return 17 + 37 * Assert.hashCode(defaultValue) + 37 * Assert.hashCode(type) + 37 * Assert.hashCode(arity) + 37 * Assert.hashCode(hidden) + 37 * Assert.hashCode(paramLabel) + 37 * Assert.hashCode(hideParamSyntax) + 37 * Assert.hashCode(required) + 37 * Assert.hashCode(splitRegex) + 37 * Arrays.hashCode(description) + 37 * Assert.hashCode(descriptionKey) + 37 * Arrays.hashCode(auxiliaryTypes) ; }
/** Constructs a new ParameterException with the specified CommandLine and error message. * @param commandLine the command or subcommand whose input was invalid * @param msg describes the problem * @param t the throwable that caused this ParameterException * @param argSpec the argSpec that caused this ParameterException * @param value the value that caused this ParameterException * @since 3.2 */ public ParameterException(CommandLine commandLine, String msg, Throwable t, ArgSpec argSpec, String value) { super(msg, t); this.commandLine = Assert.notNull(commandLine, "commandLine"); if (argSpec == null && value == null) { throw new IllegalArgumentException("ArgSpec and value cannot both be null"); } this.argSpec = argSpec; this.value = value; }
/** Replaces the option names with the specified values. At least one option name is required, and returns this builder. * @return this builder instance to provide a fluent interface */ public Builder names(String... names) { this.names = Assert.notNull(names, "names").clone(); return self(); }
/** Sets the completion candidates for this option or positional parameter, and returns this builder. * @since 3.2 */ public T completionCandidates(Iterable<String> completionCandidates) { this.completionCandidates = Assert.notNull(completionCandidates, "completionCandidates"); return self(); }
/** Sets the type to convert the option or positional parameter to before {@linkplain #setValue(Object) setting} the value, and returns this builder. * @param propertyType the type of this option or parameter. For multi-value options and positional parameters this can be an array, or a (sub-type of) Collection or Map. */ public T type(Class<?> propertyType) { this.type = Assert.notNull(propertyType, "type"); return self(); }
/** Sets the description of this option, used when generating the usage documentation, and returns this builder. * @see Option#description() */ public T description(String... description) { this.description = Assert.notNull(description, "description").clone(); return self(); }
private static boolean isNonDefault(Object[] candidate, Object[] defaultValue) { return !Arrays.equals(Assert.notNull(defaultValue, "defaultValue"), candidate); } /** Models the usage help message specification and can be used to customize the usage help message.
public void addError(PicocliException ex) { errors.add(Assert.notNull(ex, "exception")); } }
/** Sets the ANSI style to use. * @see #ansi() */ public T useAnsi(Help.Ansi ansi) { this.ansi = Assert.notNull(ansi, "ansi"); return self(); } /** Indicates that the handler should call {@link System#exit(int)} after processing completes and sets the exit code to use as the termination status. */
/** @see CommandLine#setEndOfOptionsDelimiter(String) * @since 3.5 */ public ParserSpec endOfOptionsDelimiter(String delimiter) { this.endOfOptionsDelimiter = Assert.notNull(delimiter, "end-of-options delimiter"); return this; } /** @see CommandLine#setToggleBooleanFlags(boolean) */
private static boolean isNonDefault(Object candidate, Object defaultValue) { return !Assert.notNull(defaultValue, "defaultValue").equals(candidate); } private static boolean isNonDefault(Object[] candidate, Object[] defaultValue) {
/** Sets the stream to print command output to. For use by {@code IParseResultHandler2} implementations. * @see #out() */ public T useOut(PrintStream out) { this.out = Assert.notNull(out, "out"); return self(); } /** Sets the stream to print diagnostic messages to. For use by {@code IExceptionHandler2} implementations.