/** * Looks up a string resource identified by {@code key} in this resource * bundle and formats it with the given {@code args} using * {@link String#format(String, Object[])}. */ public String format(String key, Object... args) { return MessageFormat.format(lookup(key), args); }
@Override public String toString(Locale locale) { final FormattedResourceBundle bundle = bundle(locale); return 0 == args.length ? bundle.lookup(key) : bundle.format(key, args); }