@Test public void test() { Converter c = new StringConverter(); Assert.assertEquals(null, c.convert(String.class, "")); Assert.assertEquals(null, c.convert(String.class, null)); Assert.assertEquals(" ", c.convert(String.class, " ")); Assert.assertEquals("abc", c.convert(String.class, "abc")); }
public Object convert(@SuppressWarnings("rawtypes") Class type, Object value) { if (value == null || "".equals(value.toString())) { return (String) null; } else { return value.toString(); } }
StringConverter implements Converter { public Object convert(@SuppressWarnings("rawtypes") Class type, Object value) { if (value == null || "".equals(value.toString())) { return (String) null; } else { return value.toString(); } } }
StringConverter implements Converter { public Object convert(@SuppressWarnings("rawtypes") Class type, Object value) { if (value == null || "".equals(value.toString())) { return (String) null; } else { return value.toString(); } } StringConverter(); }
StringConverter implements Converter { public Object convert(@SuppressWarnings("rawtypes") Class type, Object value) { if (value == null || "".equals(value.toString())) { return (String) null; } else { return value.toString(); } } StringConverter(); Object convert(@SuppressWarnings("rawtypes") Class type, Object value); }
StringConverter implements Converter { public Object convert(@SuppressWarnings("rawtypes") Class type, Object value) { if (value == null || "".equals(value.toString())) { return (String) null; } else { return value.toString(); } } StringConverter(); Object convert(@SuppressWarnings("rawtypes") Class type, Object value);  }