List of utility methods to do Message Format
String | format(final String message, final Object... args) format if (args == null || args.length == 0) { return message; } else { return MessageFormat.format(message, args); |
String | format(final String template, final Object... arguments) format return MessageFormat.format(template, arguments);
|
String | format(ResourceBundle bundle, String key, Object... args) format try { String message = bundle.getString(key); return MessageFormat.format(message, args); } catch (MissingResourceException e) { return '!' + key + '!'; |
String | format(String activity, Object item, Long count, Long total) format String msg; if (count != null) { if (total != null) { msg = MessageFormat.format("{0} {1} ({2} of {3})", activity, item, count, total); } else { msg = MessageFormat.format("{0} {1} ({2})", activity, item, count); } else { ... |
String | format(String key, Object... values) format return MessageFormat.format(key, values);
|
String | format(String message, Object argument) Formats the given string with the given argument. return MessageFormat.format(message, new Object[] { argument }); |
String | format(String message, Object object) format return MessageFormat.format(message, new Object[] { object }); |
String | format(String message, Object parameter) format return format(message, new Object[] { parameter }); |
String | format(String message, Object... params) Formats the message with the given arguments. if (params != null && params.length > 0) return MessageFormat.format(message, params); else return message; |
String | format(String pattern, Map format return format(pattern, params, "{", "}"); |