@Test public void toString_formatName_isNull() { assertEquals("text", new BasicFormatRenderer().toString("text", null, null)); }
@Override public String toString(final Object o, final String formatName, final Locale locale) { Check.notNull(o, "o"); final String text = Check.instanceOf(String.class, o); String result = text; if (!text.trim().isEmpty() && formatName != null) { if (formatName.equals("toUpper")) { result = text.toUpperCase(); } else if (formatName.equals("toLower")) { result = text.toLowerCase(); } else if (formatName.equals("toUpperCamelCase")) { result = toUpperCamelCase(text); } else if (formatName.equals("toLowerCamelCase")) { result = toLowerCamelCase(text); } else { throw new IllegalStateOfArgumentException("Unsupported format name: " + formatName); } } return result; }
BasicFormatRenderer implements AttributeRenderer { @Override public String toString(final Object o, final String formatName, final Locale locale) { Check.notNull(o, "o"); final String text = Check.instanceOf(String.class, o); String result = text; if (!text.trim().isEmpty() && formatName != null) { if (formatName.equals("toUpper")) { result = text.toUpperCase(); } else if (formatName.equals("toLower")) { result = text.toLowerCase(); } else if (formatName.equals("toUpperCamelCase")) { result = toUpperCamelCase(text); } else if (formatName.equals("toLowerCamelCase")) { result = toLowerCamelCase(text); } else { throw new IllegalStateOfArgumentException("Unsupported format name: " + formatName); } } return result; } }
BasicFormatRenderer implements AttributeRenderer { @Override public String toString(final Object o, final String formatName, final Locale locale) { Check.notNull(o, "o"); final String text = Check.instanceOf(String.class, o); String result = text; if (!text.trim().isEmpty() && formatName != null) { if (formatName.equals("toUpper")) { result = text.toUpperCase(); } else if (formatName.equals("toLower")) { result = text.toLowerCase(); } else if (formatName.equals("toUpperCamelCase")) { result = toUpperCamelCase(text); } else if (formatName.equals("toLowerCamelCase")) { result = toLowerCamelCase(text); } else { throw new IllegalStateOfArgumentException("Unsupported format name: " + formatName); } } return result; }  }
BasicFormatRenderer implements AttributeRenderer { @Override public String toString(final Object o, final String formatName, final Locale locale) { Check.notNull(o, "o"); final String text = Check.instanceOf(String.class, o); String result = text; if (!text.trim().isEmpty() && formatName != null) { if (formatName.equals("toUpper")) { result = text.toUpperCase(); } else if (formatName.equals("toLower")) { result = text.toLowerCase(); } else if (formatName.equals("toUpperCamelCase")) { result = toUpperCamelCase(text); } else if (formatName.equals("toLowerCamelCase")) { result = toLowerCamelCase(text); } else { throw new IllegalStateOfArgumentException("Unsupported format name: " + formatName); } } return result; }  @Override String toString(final Object o, final String formatName, final Locale locale); }
BasicFormatRenderer implements AttributeRenderer { @Override public String toString(final Object o, final String formatName, final Locale locale) { Check.notNull(o, "o"); final String text = Check.instanceOf(String.class, o); String result = text; if (!text.trim().isEmpty() && formatName != null) { if (formatName.equals("toUpper")) { result = text.toUpperCase(); } else if (formatName.equals("toLower")) { result = text.toLowerCase(); } else if (formatName.equals("toUpperCamelCase")) { result = toUpperCamelCase(text); } else if (formatName.equals("toLowerCamelCase")) { result = toLowerCamelCase(text); } else { throw new IllegalStateOfArgumentException("Unsupported format name: " + formatName); } } return result; }  @Override String toString(final Object o, final String formatName, final Locale locale);  }