@Test public void testToLongList() throws Throwable { String aStringArray = "1, 2, 3, 4"; List<Long> received = ConverterNumberList.toLongList( aStringArray, "," ); Assert.assertNotNull( received ); Assert.assertEquals( 4, received.size() ); aStringArray = ""; received = ConverterNumberList.toLongList( aStringArray, "," ); Assert.assertNotNull( received ); Assert.assertEquals( 0, received.size() ); }
public static List<Long> toLongList( String aStringArray, String aDelimiter ) throws SdiException { List<Long> result = new ArrayList<Long>(); List<Number> list = toList( aStringArray, aDelimiter ); list.stream().forEach( n -> result.add( n.longValue() ) ); return result; }
ConverterNumberList implements FieldConverter<List<Number>> { public static List<Long> toLongList( String aStringArray, String aDelimiter ) throws SdiException { List<Long> result = new ArrayList<Long>(); List<Number> list = toList( aStringArray, aDelimiter ); list.stream().forEach( n -> result.add( n.longValue() ) ); return result; } }
ConverterNumberList implements FieldConverter<List<Number>> { public static List<Long> toLongList( String aStringArray, String aDelimiter ) throws SdiException { List<Long> result = new ArrayList<Long>(); List<Number> list = toList( aStringArray, aDelimiter ); list.stream().forEach( n -> result.add( n.longValue() ) ); return result; }  }
ConverterNumberList implements FieldConverter<List<Number>> { public static List<Long> toLongList( String aStringArray, String aDelimiter ) throws SdiException { List<Long> result = new ArrayList<Long>(); List<Number> list = toList( aStringArray, aDelimiter ); list.stream().forEach( n -> result.add( n.longValue() ) ); return result; }  @Override FieldConverter<List<Number>> init( Environment aEnv, String aFieldname ); @Override List<Number> convert( String aValue ); static List<Long> toLongList( String aStringArray,
                                         String aDelimiter ); static List<Number> toList( String aStringArray, String aDelimiter ); String getDelimiter(); void setDelimiter( String aDelimiter ); }
ConverterNumberList implements FieldConverter<List<Number>> { public static List<Long> toLongList( String aStringArray, String aDelimiter ) throws SdiException { List<Long> result = new ArrayList<Long>(); List<Number> list = toList( aStringArray, aDelimiter ); list.stream().forEach( n -> result.add( n.longValue() ) ); return result; }  @Override FieldConverter<List<Number>> init( Environment aEnv, String aFieldname ); @Override List<Number> convert( String aValue ); static List<Long> toLongList( String aStringArray,
                                         String aDelimiter ); static List<Number> toList( String aStringArray, String aDelimiter ); String getDelimiter(); void setDelimiter( String aDelimiter ); static final String CONVERTER_NAME; static final String DELIMITER_SUFFIX; }