Adds a parameter that requires a string argument to the argument list.
If the given argument is null, then the argument list remains unchanged.
774538
ArgumentsBuilder param(String param, String value) {
        if (value != null) {
            args.add(param);
            args.add(value);
        }
        return this;
    }
889934
private static void checkArguments(final Object... args) {
        for (Object o : args) {
            if (o == null) {
                throw new NullPointerException("argument can not be null " + Arrays.toString(args));
            }
        }
    }
622348
protected void addToMap(String argument, Map m) throws CmdLineException {
    	if (String.valueOf(argument).indexOf('=') == -1) {
    		throw new CmdLineException(owner,Messages.FORMAT_ERROR_FOR_MAP);
    	}

		String mapKey;
		String mapValue;

		//Splitting off the key from the value
        int idx = argument.indexOf('=');
        if (idx>=0) {
            mapKey = argument.substring(0, idx);
            mapValue = argument.substring(idx + 1);
            if (mapValue.length()==0)
                // Kohsuke: I think this is a bad choice, but this is needed to remain backward compatible
                mapValue = null;
        } else {
            mapKey = argument;
            mapValue = null;
        }

    	if (mapKey.length()==0) {
    		throw new CmdLineException(owner,Messages.MAP_HAS_NO_KEY);
    	}

        addToMap(m, mapKey, mapValue);
    }
1300343
public function addArguments(?string $arguments = null)
    {
        $args = [];
        preg_match_all('/(?P<argument>\w+):(?P<value>[\w+\-]+)/', $arguments, $matches);
        if (isset($matches['argument'])) {
            foreach ($matches['argument'] as $key => $argKey) {
                if (isset($matches['value'][$key])) {
                    $args[$argKey] = $matches['value'][$key];
                }
            }
        }
        $this->arguments = $args;
    }
13944
@Override
  public Long add11(Long arg1, Long arg2) {
    if (arg1 == null || arg2 == null) {
      return null;
    } else {
      return arg1 + arg2;
    }
  }
1148458
public void add(final Param key, final String[] value) {
        if (value != null && value.length > 0) {
            parameters.put(key, toList(value));
        }
    }
233987
protected String getParameterAsString(Object arg) {
        if (arg instanceof String) {
            return (String) arg;
        }
        return arg == null ? "null" : arg.toString();
    }
249112
public static void notEmpty(final CharSequence str, final String parameterName) {
		if (str == null || str.length() == 0) {
			throw new IllegalArgumentException('"' + parameterName + "\" must not be null or empty, but was: " + str);
		}
	}
1017539
def InsertArg(self, string='', **unused_kwargs):
    """"""
    logging.debug('Storing Argument {0:s}'.format(string))

    # This expression is complete
    if self.current_expression.AddArg(string):
      self.stack.append(self.current_expression)
      self.current_expression = self.expression_cls()
      return self.PopState()
    return None
514770
public CommandArgs<K, V> add(String s) {

        singularArguments.add(StringArgument.of(s));
        return this;
    }
1137824
public void addParameter(String name, Object value) {
        if (name == null) {
            throw new IllegalArgumentException("name must not be null");
        }
        params.put(name, value);
    }
1110966
public static void notEmpty(final String arg, final String name) {
        if(arg == null) {
            throw new NullPointerException(String.format("%s should not be null.", name));
        }
        
        if(arg.isEmpty()) {
            throw new IllegalArgumentException(String.format("%s should not be empty.", name));
        }
    }
750594
public void addParam(String name, String value) {
        if (name == null) {
            throw new NullPointerException("name");
        }
        if (value == null) {
            throw new NullPointerException("value");
        }
        params.add(new Param(name, value));
    }
1178928
public void addValue(
                    final Object value
                    )
    {
        if (value == null) {
            setNullContained( true );
        } else {
            _values.add( String.valueOf( value ) );
        }
    }
594054
def add_argument(self, *args, **kwargs):
        
        if not (('action' in kwargs) and (kwargs['action'] == 'help')):
            # make sure required parameter options were defined
            try:
                name = kwargs['dest']
                param_type = kwargs['type']
                optional = kwargs['optional']
            except KeyError as e:
                detail = "%s option required. " % e
                raise KeyError(detail)
            if optional and ('default' not in kwargs):
                detail = "A default value is required for optional parameters %s." % name
                raise KeyError(detail)

            # grab the default and help values
            default = None
            if 'default' in kwargs:
                default = kwargs['default']
            param_help = ""
            if 'help' in kwargs:
                param_help = kwargs['help']

            # set the ArgumentParser's action
            if param_type not in (str, int, float, bool, ChrisApp.path):
                detail = "unsupported type: '%s'" % param_type
                raise ValueError(detail)
            action = 'store'
            if param_type == bool:
                action = 'store_false' if default else 'store_true'
                del kwargs['default'] # 'default' and 'type' not allowed for boolean actions
                del kwargs['type']
            kwargs['action'] = action

            # store the parameters internally (param_type.__name__ to enable json serialization)
            param = {'name': name, 'type': param_type.__name__, 'optional': optional,
                     'flag': args[0], 'action': action, 'help': param_help, 'default': default}
            self._parameters.append(param)

            # add the parameter to the parser
            del kwargs['optional']
        ArgumentParser.add_argument(self, *args, **kwargs)
1220625
protected void addCommandLineArgument(StringBuilder buffer,String argument,String value)
    {
        if((value!=null)&&(value.length()>0))
        {
            buffer.append(argument);
            buffer.append(Fax4jExeConstants.SPACE_STR);
            buffer.append(Fax4jExeConstants.VALUE_WRAPPER);
            buffer.append(value);
            buffer.append(Fax4jExeConstants.VALUE_WRAPPER);
            buffer.append(Fax4jExeConstants.SPACE_STR);
        }
    }
566672
public void addParam(String strParam, Map<String,Object> properties)
    {
        this.addParam(strParam, (Object)properties);
    }