/** * Create an {@link Argument} with the specified value. * * @param arg the value of the {@link Argument} * @param options the {@link Option}s for this {@link Argument} * * @return an {@link Argument} with the specified value */ public static Argument of(Object arg, Option... options) { return new Argument(arg, options); }
/** * Replace the first {@link Argument} with the specified name * with a new {@link Argument} with the specified value * * @param name the name of the argument * @param value the value of the argument * * @return a new {@link Arguments} instance with the specified * argument replaced */ public Arguments replace(String name, Object value) { Argument argument = Argument.of(name, value); return replace(argument); }
String name = argument.getName(); char separator = argument.getSeparator(); List<String> values = argument.resolve(platform, evaluator, optionsByType);
Object result = resolveValue(argValue, platform, evaluator, optionsByType); Object result = resolveValue(value, platform, evaluator, optionsByType); OptionsByType argOptions = getOptions(); Iterable<ResolveHandler> handlers = argOptions.getInstancesOf(ResolveHandler.class);
/** * Replace the first {@link Argument} with the specified name * with a new {@link Argument} with the specified value * * @param name the name of the argument * @param value the value of the argument * * @return a new {@link Arguments} instance with the specified * argument replaced */ public Arguments replace(String name, Object value) { Argument argument = Argument.of(name, value); return replace(argument); }
String name = argument.getName(); char separator = argument.getSeparator(); List<String> values = argument.resolve(platform, evaluator, optionsByType);
Object result = resolveValue(argValue, platform, evaluator, optionsByType); Object result = resolveValue(value, platform, evaluator, optionsByType); OptionsByType argOptions = getOptions(); Iterable<ResolveHandler> handlers = argOptions.getInstancesOf(ResolveHandler.class);
/** * Create an {@link Argument} with the specified value. * * @param arg the value of the {@link Argument} * @param options the {@link Option}s for this {@link Argument} * * @return an {@link Argument} with the specified value */ public static Argument of(Object arg, Option... options) { return new Argument(arg, options); }
/** * Obtain a new {@link Arguments} that is the same as this * {@link Arguments} instance with the all occurrences of * any {@link Argument} with the specified name removed. * * @param name the name of the argument to remove * * @return a new {@link Arguments} that is the same as this * {@link Arguments} instance with the all occurrences * of the specified named {@link Argument} removed */ public Arguments withoutNamed(String name) { Arguments newArguments = new Arguments(); for (Argument argument : this.arguments) { String argName = argument.getName(); if (!safeEquals(argName, name)) { newArguments.arguments.add(argument); } } return newArguments; }
/** * Create an {@link Argument} with the specified value. * * @param name the name of the argument * @param arg the value of the {@link Argument} * @param options the {@link Option}s for this {@link Argument} * * @return an {@link Argument} with the specified value */ public static Argument of(String name, Object arg, Option... options) { return new Argument(name, arg, options); }
/** * Obtain a new {@link Arguments} that is the same as this * {@link Arguments} instance with the all occurrences of * any {@link Argument} with the specified name removed. * * @param name the name of the argument to remove * * @return a new {@link Arguments} that is the same as this * {@link Arguments} instance with the all occurrences * of the specified named {@link Argument} removed */ public Arguments withoutNamed(String name) { Arguments newArguments = new Arguments(); for (Argument argument : this.arguments) { String argName = argument.getName(); if (!safeEquals(argName, name)) { newArguments.arguments.add(argument); } } return newArguments; }
/** * Create an {@link Argument} with the specified value. * * @param name the name of the argument * @param arg the value of the {@link Argument} * @param options the {@link Option}s for this {@link Argument} * * @return an {@link Argument} with the specified value */ public static Argument of(String name, Object arg, Option... options) { return new Argument(name, arg, options); }
Argument.of(StringHelper.doubleQuoteIfNecessary(file.toString())), DisplayName.of("Undeploy")))
/** * Create an {@link Argument} with the specified name, * value and separator. * * @param name the name of the argument * @param separator the separator to use between the name * and value when resolving this argument * @param arg the value of the {@link Argument} * @param options the {@link Option}s for this {@link Argument} * * @return an {@link Argument} with the specified value */ public static Argument of(String name, char separator, Object arg, Option... options) { return new Argument(name, separator, arg, options); }
/** * Create an {@link Argument} with the specified name, * value and separator. * * @param name the name of the argument * @param separator the separator to use between the name * and value when resolving this argument * @param arg the value of the {@link Argument} * @param options the {@link Option}s for this {@link Argument} * * @return an {@link Argument} with the specified value */ public static Argument of(String name, char separator, Object arg, Option... options) { return new Argument(name, separator, arg, options); }