Coverts list of objects to {@code List<String>}.

@param args list of objects that will be converted to list of strings.
@return non-null, unmodifiable list of strings.
342978
@NonNull
    public static List<String> unmodifiableNonNullListOfStrings(@Nullable List<?> args) {
        if (args == null || args.isEmpty()) {
            return emptyList();
        } else {
            final List<String> list = new ArrayList<String>(args.size());

            for (Object arg : args) {
                list.add(arg != null ? arg.toString() : "null");
            }

            return unmodifiableList(list);
        }
    }
769750
private Class<?>[] getTypes(Object[] args) {
        if (args == null || args.length == 0) {
            return null;
        }
        List<Class<?>> classList = new ArrayList<Class<?>>();
        for (Object obj : args) {
            classList.add(obj == null ? Object.class : obj.getClass());
        }
        return classList.toArray(new Class[] {});
    }
234712
@SafeVarargs
  public final QueryBuilder arguments(Object...args) {
    set(Param.QUERY_ARGS, "");
    queryArgs = args.clone();
    return this;
  }
1228738
public static String format(String formatString, Object... args) {
    // Rewrites the varargs so that objects that need special formatting are
    // replaced with formatted strings, then hands off to {@link String#format}.

    Object[] formattedArgs = new Object[args.length];
    for (int i = 0; i < args.length; ++i) {
      formattedArgs[i] = formatObject(args[i]);
    }

    return String.format(formatString, (Object[]) formattedArgs);
  }
612173
public static String[] propertiesToArgs(Map<String,Object> properties)
    {
        if (properties == null)
            return null;
        String[] rgArgs = new String[properties.size()];
        int i = 0;
        for (String strKey : properties.keySet())
        {
            Object strValue = properties.get(strKey);
            rgArgs[i++] = strKey.toString() + '=' + strValue.toString();
        }
        return rgArgs;
    }
145726
public static String[] removeFirst(String[] args) {
		String[] args2 = new String[args.length - 1];
		System.arraycopy(args, 1, args2, 0, args2.length);
		return args2;
	}
701161
@SafeVarargs
  static <T> String sqlArgumentList(T... values) {
    StringBuilder sb = new StringBuilder();
    if (values.length != 0) {
      sb.append(values[0]);
      for (int i=1; i < values.length; i++) {
        sb.append(',').append(' ').append(values[i]);
      }
    }
    return sb.toString();
  }
867642
protected final void parse(List<String> args) {
    Pattern eqSeparatedOpt = Pattern.compile("(--[^=]+)=(.+)");

    int idx = 0;
    for (idx = 0; idx < args.size(); idx++) {
      String arg = args.get(idx);
      String value = null;

      Matcher m = eqSeparatedOpt.matcher(arg);
      if (m.matches()) {
        arg = m.group(1);
        value = m.group(2);
      }

      // Look for options with a value.
      String name = findCliOption(arg, opts);
      if (name != null) {
        if (value == null) {
          if (idx == args.size() - 1) {
            throw new IllegalArgumentException(
                String.format("Missing argument for option '%s'.", arg));
          }
          idx++;
          value = args.get(idx);
        }
        if (!handle(name, value)) {
          break;
        }
        continue;
      }

      // Look for a switch.
      name = findCliOption(arg, switches);
      if (name != null) {
        if (!handle(name, null)) {
          break;
        }
        continue;
      }

      if (!handleUnknown(arg)) {
        break;
      }
    }

    if (idx < args.size()) {
      idx++;
    }
    handleExtraArgs(args.subList(idx, args.size()));
  }
59570
public static CmdArgs read(String[] args) {
        Map<String, String> map = new LinkedHashMap<>();
        for (String arg : args) {
            int index = arg.indexOf("=");
            if (index <= 0) {
                continue;
            }

            String key = arg.substring(0, index);
            if (key.startsWith("-")) {
                key = key.substring(1);
            }

            if (key.startsWith("-")) {
                key = key.substring(1);
            }

            String value = arg.substring(index + 1);
            String old = map.put(toLowerCase(key), value);
            if (old != null)
                throw new IllegalArgumentException("Pair '" + toLowerCase(key) + "'='" + value + "' not possible to " +
                        "add to the CmdArgs-object as the key already exists with '" + old + "'");
        }

        return new CmdArgs(map);
    }
1118042
public Map<String, String> parseArgs(String[] args) {

        Map<String, String> result = new HashMap<String, String>();
        Set<String> allowedKeys = new HashSet<String>(
            Arrays.asList(PARAM_ADDITIONAL, PARAM_SCRIPT, PARAM_REGISTRY_PORT));
        for (String arg : args) {
            if (arg.startsWith("-")) {
                int eqPos = arg.indexOf("=");
                if (eqPos >= 0) {
                    String key = arg.substring(1, eqPos);
                    if (!allowedKeys.contains(key)) {
                        wrongUsage();
                    }
                    String val = arg.substring(eqPos + 1);
                    result.put(key, val);
                } else {
                    wrongUsage();
                }
            } else {
                wrongUsage();
            }
        }
        return result;
    }
41518
@Override
    public List<Class<?>> scan(Object... args) {
        if (args == null || args.length == 0) {
            return Collections.emptyList();
        }
        List<Class<?>> result = null;
        for (Object obj : args) {
            List<Class<?>> list = scan((String) obj);
            if (result == null) {
                result = list;
            } else {
                result.addAll(list);
            }
        }
        return result;
    }
479990
public final void setArgs(String... args) throws CmdArgsException
    {
        try
        {
            options = new HashMap<>();
            Option opt = null;
            int index = 0;
            for (String arg : args)
            {
                if (opt != null)
                {
                    options.put(opt.name, ConvertUtility.convert(opt.cls, arg));
                    opt = null;
                }
                else
                {
                    if (map.containsKey(arg))
                    {
                        opt = map.get(arg);
                        if (opt.exclusiveGroup != null)
                        {
                            if (effectiveGroup != null && !effectiveGroup.equals(opt.exclusiveGroup))
                            {
                                throw new CmdArgsException(opt.exclusiveGroup+" mix with "+effectiveGroup, this);
                            }
                            effectiveGroup = opt.exclusiveGroup;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                index++;
            }
            // defaults
            for (Option o : map.values())
            {
                if (!o.mandatory && !options.containsKey(o.name))
                {
                    options.put(o.name, o.defValue);
                }
            }
            int len = args.length-index;
            if (hasArrayArgument)
            {
                if (len < types.size())
                {
                    throw new CmdArgsException("too few arguments", this);
                }
            }
            else
            {
                if (len != types.size())
                {
                    throw new CmdArgsException("wrong number of arguments", this);
                }
            }
            arguments = new HashMap<>();
            int arraySize = len - types.size() + 1;
            int arrayIndex = Integer.MAX_VALUE;
            Object array = null;
            Class<?> componenType = null;
            if (hasArrayArgument)
            {
                arrayIndex = types.size()-1;
                Class<?> arrayType = types.get(arrayIndex);
                componenType = arrayType.getComponentType();
                array = Array.newInstance(componenType, arraySize);
                arguments.put(names.get(arrayIndex), array);
            }
            for (int ii=0;ii<len;ii++)
            {
                if (ii < arrayIndex)
                {
                    Object value = ConvertUtility.convert(types.get(ii), args[ii+index]);
                    arguments.put(names.get(ii), value);
                }
                else
                {
                    Object value = ConvertUtility.convert(componenType, args[ii+index]);
                    Array.set(array, ii - arrayIndex, value);
                }
            }
            for (Option o : map.values())
            {
                if (o.mandatory && !options.containsKey(o.name))
                {
                    throw new CmdArgsException("mandatory option "+o.name+": "+o.description+" missing", this);
                }
            }
            if (effectiveGroup != null)
            {
                for (Option o : groups.get(effectiveGroup))
                {
                    if (o.mandatory && !options.containsKey(o.name))
                    {
                        throw new CmdArgsException(effectiveGroup+" option "+o.name+": "+o.description+" missing", this);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            throw new CmdArgsException(ex, this);
        }
    }
1255888
public static List<Map<String, Object>> getListMap(String sql, Object... arg) {
        Connection connection = JDBCUtils.getConnection();
        PreparedStatement ps = null;
        ResultSet result = null;
        List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
        try {
            ps = connection.prepareStatement(sql);
            for (int i = 0; i < arg.length; i++) {
                ps.setObject(i + 1, arg[i]);
            }

            result = ps.executeQuery();
            listMap = DBUtils.handleResultSetToMapList(result, listMap);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            JDBCUtils.release(result, ps, connection);
        }
        return listMap;
    }
285568
public java.util.List<String> getArgs() {
        if (args == null) {
            args = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return args;
    }
1101619
public static String in(Object[] args) {
		if (EmptyUtil.isEmpty(args) == true) {
			return "";
		}
		StringBuilder sql = new StringBuilder();
		Arrays.asList(args).forEach(arg -> {
			if (arg == null) {
				sql.append("NULL");
			} else if (arg instanceof CharSequence) {
				sql.append("'").append(arg).append("'");
			} else {
				sql.append(arg);
			}
			sql.append(", ");
		});
		sql.setLength(sql.length() - ", ".length());
		return sql.toString().trim();
	}
166050
public List<String> path(List<String> args) throws IOException {
    return ImmutableList.<String>builder().add(path).addAll(args).build();
  }
977615
@Nonnull
    public final ArrayList<A> toArrayList() {
        ArrayList<A> list = new ArrayList<>(this.length);
        ImmutableList<A> l = this;
        for (int i = 0; i < length; i++) {
            list.add(((NonEmptyImmutableList<A>) l).head);
            l = ((NonEmptyImmutableList<A>) l).tail;
        }
        return list;
    }