标签:string 代码 rmi hold mic template esc 参考 href
部分方法:
checkArgument使用:Preconditions.checkArgument(permits > 0, "Requested permits (%s) must be positive", permits);
checkNotNull实现:
format方法:format("%s (%s) must not be greater than size (%s)", desc, index, size);
static String format(String template, @Nullable Object... args) { template = String.valueOf(template); StringBuilder builder = new StringBuilder(template.length() + 16 * args.length); int templateStart = 0; int i; int placeholderStart; for(i = 0; i < args.length; templateStart = placeholderStart + 2) { placeholderStart = template.indexOf("%s", templateStart); if (placeholderStart == -1) { break; } builder.append(template, templateStart, placeholderStart); builder.append(args[i++]); } builder.append(template, templateStart, template.length()); if (i < args.length) { builder.append(" ["); builder.append(args[i++]); while(i < args.length) { builder.append(", "); builder.append(args[i++]); } builder.append(‘]‘); } return builder.toString(); }
标签:string 代码 rmi hold mic template esc 参考 href
原文地址:https://www.cnblogs.com/clarino/p/13347242.html