@Test( expected = IllegalArgumentException.class ) public void testUpdateDataException() { String[] names = new String[]{ "name_0" }; Object[] values = new Object[]{ "value_0" }; StaticDataRow dataRow = new StaticDataRow( names, values ); Object[] newValues = new Object[]{ "new_value_0", "new_value_1" }; dataRow.updateData( newValues ); }
protected void updateData( final Object[] values ) { if ( values.length != this.values.size() ) { throw new IllegalArgumentException( "You should preserve the number of columns." ); } final HashMap<String, Object> valueMap = new HashMap<String, Object>(); final int length = Math.min( names.length, values.length ); for ( int i = 0; i < length; i++ ) { final String name = names[i]; valueMap.put( name, values[i] ); } this.values = Collections.unmodifiableMap( valueMap ); }
StaticDataRow implements DataRow { protected void updateData( final Object[] values ) { if ( values.length != this.values.size() ) { throw new IllegalArgumentException( "You should preserve the number of columns." ); } final HashMap<String, Object> valueMap = new HashMap<String, Object>(); final int length = Math.min( names.length, values.length ); for ( int i = 0; i < length; i++ ) { final String name = names[i]; valueMap.put( name, values[i] ); } this.values = Collections.unmodifiableMap( valueMap ); } }
StaticDataRow implements DataRow { protected void updateData( final Object[] values ) { if ( values.length != this.values.size() ) { throw new IllegalArgumentException( "You should preserve the number of columns." ); } final HashMap<String, Object> valueMap = new HashMap<String, Object>(); final int length = Math.min( names.length, values.length ); for ( int i = 0; i < length; i++ ) { final String name = names[i]; valueMap.put( name, values[i] ); } this.values = Collections.unmodifiableMap( valueMap ); } StaticDataRow(); protected  StaticDataRow( final StaticDataRow dataRow );  StaticDataRow( final DataRow dataRow );  StaticDataRow( final String[] names, final Object[] values );  StaticDataRow( final Map<String, Object> parameterValues ); }
StaticDataRow implements DataRow { protected void updateData( final Object[] values ) { if ( values.length != this.values.size() ) { throw new IllegalArgumentException( "You should preserve the number of columns." ); } final HashMap<String, Object> valueMap = new HashMap<String, Object>(); final int length = Math.min( names.length, values.length ); for ( int i = 0; i < length; i++ ) { final String name = names[i]; valueMap.put( name, values[i] ); } this.values = Collections.unmodifiableMap( valueMap ); } StaticDataRow(); protected  StaticDataRow( final StaticDataRow dataRow );  StaticDataRow( final DataRow dataRow );  StaticDataRow( final String[] names, final Object[] values );  StaticDataRow( final Map<String, Object> parameterValues ); String[] getColumnNames(); Object get( final String col ); boolean isChanged( final String name ); boolean equals( final Object o ); int hashCode(); }
StaticDataRow implements DataRow { protected void updateData( final Object[] values ) { if ( values.length != this.values.size() ) { throw new IllegalArgumentException( "You should preserve the number of columns." ); } final HashMap<String, Object> valueMap = new HashMap<String, Object>(); final int length = Math.min( names.length, values.length ); for ( int i = 0; i < length; i++ ) { final String name = names[i]; valueMap.put( name, values[i] ); } this.values = Collections.unmodifiableMap( valueMap ); } StaticDataRow(); protected  StaticDataRow( final StaticDataRow dataRow );  StaticDataRow( final DataRow dataRow );  StaticDataRow( final String[] names, final Object[] values );  StaticDataRow( final Map<String, Object> parameterValues ); String[] getColumnNames(); Object get( final String col ); boolean isChanged( final String name ); boolean equals( final Object o ); int hashCode();  }