@Test public void testConvert() { Object[][] testCases = { {new Integer(17), "17"}, {new Float(1. / 3), "0.33333334"}, {(byte) 100, "100"}, {null, null}, {"123", "123"},}; for (Object[] testCase : testCases) { Object obj = testCase[0]; String expectedValue = (String) testCase[1]; StringHolder holder = type.convert(obj); assertEquals(expectedValue, holder.getValue()); } }
@Override public StringHolder convert(Object obj) { return new StringHolder(obj != null ? obj.toString() : null); }
StringType implements Type<StringHolder> { @Override public StringHolder convert(Object obj) { return new StringHolder(obj != null ? obj.toString() : null); } }
StringType implements Type<StringHolder> { @Override public StringHolder convert(Object obj) { return new StringHolder(obj != null ? obj.toString() : null); }  }
StringType implements Type<StringHolder> { @Override public StringHolder convert(Object obj) { return new StringHolder(obj != null ? obj.toString() : null); }  @Override String encode(StringHolder holder); @Override StringHolder decode(String text); @Override StringHolder convert(Object obj); @Override StringHolder[] newArray(int size); }
StringType implements Type<StringHolder> { @Override public StringHolder convert(Object obj) { return new StringHolder(obj != null ? obj.toString() : null); }  @Override String encode(StringHolder holder); @Override StringHolder decode(String text); @Override StringHolder convert(Object obj); @Override StringHolder[] newArray(int size); static final String TYPE_NAME; }