Produces the flag form of an integer using {@link Integer#toString()}, separated by an equals
character.

@return {@code [--name=value]} or {@code []} if value is null.
978244
static List<String> integerWithEq(String name, @Nullable Integer value) {
    if (value != null) {
      return Collections.singletonList("--" + name + "=" + value.toString());
    }
    return Collections.emptyList();
  }
366489
public static String flagsToString(short flags) {
        StringBuilder sb=new StringBuilder();
        boolean first=true;

        Flag[] all_flags=Flag.values();
        for(Flag flag: all_flags) {
            if(isFlagSet(flags, flag)) {
                if(first)
                    first=false;
                else
                    sb.append("|");
                sb.append(flag);
            }
        }
        return sb.toString();
    }
722892
@Nullable
    public static String toArraySignature(String typeName) {
        String sig = classToSignature(typeName);
        if ((sig == null) || (sig.length() == 0)) {
            return sig;
        }
        return Values.SIG_ARRAY_PREFIX + sig;
    }
421262
public static String writeInteger(Integer value) {
		if (value==null) return null;
		
		return Integer.toString(value);			
	}
779780
public static String getStringValue(Node n) {
    // TODO(user): regex literals as well.
    switch (n.getToken()) {
      case STRING:
      case STRING_KEY:
        return n.getString();

      case TEMPLATELIT:
        // Only convert a template literal if all its expressions can be converted.
        String string = "";
        for (Node child = n.getFirstChild(); child != null; child = child.getNext()) {
          Node expression = child;
          if (child.isTemplateLitSub()) {
            expression = child.getFirstChild();
          }
          String expressionString = getStringValue(expression);
          if (expressionString == null) {
            // Cannot convert.
            return null;
          }
          string = string + expressionString;
        }
        return string;

      case TEMPLATELIT_STRING:
        return n.getCookedString();

      case NAME:
        String name = n.getString();
        if ("undefined".equals(name)
            || "Infinity".equals(name)
            || "NaN".equals(name)) {
          return name;
        }
        break;

      case NUMBER:
        return DToA.numberToString(n.getDouble());

      case FALSE:
        return "false";

      case TRUE:
        return "true";

      case NULL:
        return "null";

      case VOID:
        return "undefined";

      case NOT:
        TernaryValue child = getPureBooleanValue(n.getFirstChild());
        if (child != TernaryValue.UNKNOWN) {
          return child.toBoolean(true) ? "false" : "true"; // reversed.
        }
        break;

      case ARRAYLIT:
        return arrayToString(n);

      case OBJECTLIT:
        return "[object Object]";
      default:
        break;
    }
    return null;
  }
147935
public static String format(int[] a, String sep) {
    return (a == null) ? "null" : (a.length == 0) ? "" : //
        formatTo(new StringBuilder(), a, sep).toString();
  }
883693
public long getFirstNumericValue() {
    String val = (value != null) ? value.get(0).toString() : readValue.get(0).toString();
    if (isInteger(val)) {
      return Long.parseLong(val);
    } else {
      return 0;
    }
  }
1105475
public String getValue() {
    StringBuilder b = new StringBuilder(open ? "[" : "(");

    for (int p = 0; p < points.length; p++) {
      if (p > 0) {
        b.append(",");
      }
      b.append(points[p].toString());
    }
    b.append(open ? "]" : ")");

    return b.toString();
  }
1305649
@Override
	public String getValueAsString() {
		String result = null;

		String[] inputs = getValue();

		if (inputs != null && inputs.length > 0) {
			StringBuffer stringValues = new StringBuffer();

			for (int i = 0; i < inputs.length; i++) {
				if (i > 0) {
					stringValues.append(", ");
				}

				stringValues.append(inputs[i]);
			}

			result = stringValues.toString();

		}

		return result;
	}
967573
public static String[] getStringArray(
    Object  value) throws ParseException
  {
    if (value == null)
    {
        return null;
    }

    return getTokensArray(value.toString());
  }
830812
public String getValueList()
    {
        final StringBuffer buf = new StringBuffer();

        for (final Token token : this.tokens) {
            switch (token.type) {
                case EXPRESSION:
                    buf.append("$<").append(token.value).append(">");
                    break;
                case TEXT:
                    buf.append(token.value);
                    break;
                default:
                    break;
            }
        }
        return buf.toString();
    }
1255839
public List<String> getAsStrings() {
        if (this.isEmpty()) {
            return Collections.emptyList();
        } else {
            final List<String> toStringVals = new ArrayList<>(this.size());
            for (final T i : this) {
                toStringVals.add(i == null ? "null" : i.toString());
            }
            return toStringVals;
        }
    }
845618
public static final Integer parseInteger(String value)
   {
      return (value == null || value.length() == 0 ? null : Integer.valueOf(Integer.parseInt(value)));
   }
1167700
public String toCode() {
        String ret = "";
        if (StringUtils.isEmpty(scope)) {
            ret = "private ";
        } else {
            ret = scope + ClassCode.BLANK_STRING;
        }
        
        ret += type + ClassCode.BLANK_STRING + name;
        
        if (!StringUtils.isEmpty(defaultValue)) {
            ret += "=" + defaultValue;
        }
        
        return ret;
    }
903155
protected String getValue(String arg) {
        String[] split = arg.split("=");
        if (split.length == 1) {
            return null;
        } else if (split.length == 2) {
            return split[1];
        } else {
            // Handle DN case with multiple =s
            StringBuffer value = new StringBuffer();
            for (int i = 1; i < split.length; i++) {
                value.append(split[i]);
                if (i < (split.length - 1)) {
                    value.append("=");
                }
            }
            return value.toString();
        }
    }
1090296
public static final Nature fromString(String name)
    {
        Integer id = idMap.get(name);
        if (id == null)
            return null;
        return values[id];
    }
2341
protected String getValuesString() {
        final StringBuilder builder = new StringBuilder();

        for(final String value : values) {
            builder.append(AciURLCodec.getInstance().encode(value)).append(',');
        }

        if(builder.length() > 0) {
            builder.deleteCharAt(builder.length() - 1);
        }

        return builder.toString();
    }