@Test public void lazyArgumentSupplier() { Supplier<Integer> supplier = () -> 42; assertThat(format("It is %d", supplier)).isEqualTo("It is 42"); }
@Override public String format(final String message, final Object[] arguments) { try { return String.format(locale, message, resolve(arguments)); } catch (IllegalFormatException ex) { InternalLogger.log(Level.WARN, ex, "Illegal printf format message '" + message + "'"); return message; } }
PrintfStyleFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return String.format(locale, message, resolve(arguments)); } catch (IllegalFormatException ex) { InternalLogger.log(Level.WARN, ex, "Illegal printf format message '" + message + "'"); return message; } } }
PrintfStyleFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return String.format(locale, message, resolve(arguments)); } catch (IllegalFormatException ex) { InternalLogger.log(Level.WARN, ex, "Illegal printf format message '" + message + "'"); return message; } } PrintfStyleFormatter(final Locale locale); }
PrintfStyleFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return String.format(locale, message, resolve(arguments)); } catch (IllegalFormatException ex) { InternalLogger.log(Level.WARN, ex, "Illegal printf format message '" + message + "'"); return message; } } PrintfStyleFormatter(final Locale locale); @Override String format(final String message, final Object[] arguments); }
PrintfStyleFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return String.format(locale, message, resolve(arguments)); } catch (IllegalFormatException ex) { InternalLogger.log(Level.WARN, ex, "Illegal printf format message '" + message + "'"); return message; } } PrintfStyleFormatter(final Locale locale); @Override String format(final String message, final Object[] arguments);  }