private static <T> void fillWithConstructor( @NonNull final CursorGetter getter, final List<T> lists, final @NonNull Constructor<T> constructor) { try { while (getter.moveToNext()) { lists.add(constructor.newInstance(getter)); } } catch (final InstantiationException e) { throw new IllegalArgumentException( "go and make the constructor " + constructor.getName() + "(CursorWrapper.CursorGetter) accessible", e); } catch (final IllegalAccessException e) { throw new IllegalArgumentException( "go and make the constructor " + constructor.getName() + "(CursorWrapper.CursorGetter) accessible", e); } catch (final InvocationTargetException e) { throw new IllegalArgumentException( "go and make the constructor " + constructor.getName() + "(CursorWrapper.CursorGetter) accessible", e); } }
private static <T> void fillWithConvertor( @NonNull final CursorGetter getter, final List<T> list, final CursorWrapper.CursorConverter<T> converter) { while (getter.moveToNext()) { list.add(converter.convert(getter)); } }