@Test public void testConvert__array() { Object[][] arrays = { {1L, 2L, 3L}, {} }; Object[][] expectations = { new IntegerHolder[]{new IntegerHolder(1L), new IntegerHolder(2L), new IntegerHolder(3L)}, new IntegerHolder[]{} }; for (int i = 0; i < arrays.length; i++) { Object[] array = arrays[i]; IntegerHolder[] expected = (IntegerHolder[]) expectations[i]; ValueHolder[] result = TypeDecoder.convert(type, array); checkArrays(expected, result); } }
public static ValueHolder convert(Type<?> type, Object obj) { try { return type.convert(obj); } catch (RuntimeException exception) { throw new TypeConversionException(exception, obj, type); } }
TypeDecoder { public static ValueHolder convert(Type<?> type, Object obj) { try { return type.convert(obj); } catch (RuntimeException exception) { throw new TypeConversionException(exception, obj, type); } } }
TypeDecoder { public static ValueHolder convert(Type<?> type, Object obj) { try { return type.convert(obj); } catch (RuntimeException exception) { throw new TypeConversionException(exception, obj, type); } } private  TypeDecoder(); }
TypeDecoder { public static ValueHolder convert(Type<?> type, Object obj) { try { return type.convert(obj); } catch (RuntimeException exception) { throw new TypeConversionException(exception, obj, type); } } private  TypeDecoder(); static ValueHolder decode(Type<?> type, String text); static ValueHolder convert(Type<?> type, Object obj); static ValueHolder[] convert(Type<?> type, Object[] array); static ValueHolder[] convert(Type<?> type, Collection<?> coll); }
TypeDecoder { public static ValueHolder convert(Type<?> type, Object obj) { try { return type.convert(obj); } catch (RuntimeException exception) { throw new TypeConversionException(exception, obj, type); } } private  TypeDecoder(); static ValueHolder decode(Type<?> type, String text); static ValueHolder convert(Type<?> type, Object obj); static ValueHolder[] convert(Type<?> type, Object[] array); static ValueHolder[] convert(Type<?> type, Collection<?> coll);  }