@Test public void testGetNativeData_emptyIsNull() throws Exception { meta.setNullsAndEmptyAreDifferent( false ); assertEquals( BASE_VALUE, meta.getNativeDataType( BASE_VALUE ) ); assertEquals( TEST_VALUE, meta.getNativeDataType( TEST_VALUE ) ); assertEquals( null, meta.getNativeDataType( null ) ); assertEquals( "1", meta.getNativeDataType( 1 ) ); assertEquals( "1.0", meta.getNativeDataType( 1.0 ) ); Date d = ( new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.SSS" ) ).parse( "2012-11-10 09:08:07.654" ); assertEquals( d.toString(), meta.getNativeDataType( d ) ); Timestamp ts = Timestamp.valueOf( "2012-11-10 09:08:07.654321" ); assertEquals( "2012-11-10 09:08:07.654321", meta.getNativeDataType( ts ) ); meta.setTrimType( ValueMetaInterface.TRIM_TYPE_NONE ); assertEquals( "", meta.getNativeDataType( "" ) ); assertEquals( "1", meta.getNativeDataType( "1" ) ); assertEquals( " ", meta.getNativeDataType( " " ) ); assertEquals( " 1 ", meta.getNativeDataType( " 1 " ) ); meta.setTrimType( ValueMetaInterface.TRIM_TYPE_LEFT ); assertEquals( "", meta.getNativeDataType( "" ) ); assertEquals( "1", meta.getNativeDataType( "1" ) ); assertEquals( "", meta.getNativeDataType( " " ) ); assertEquals( "1 ", meta.getNativeDataType( " 1 " ) ); meta.setTrimType( ValueMetaInterface.TRIM_TYPE_RIGHT ); assertEquals( "", meta.getNativeDataType( "" ) ); assertEquals( "1", meta.getNativeDataType( "1" ) ); assertEquals( "", meta.getNativeDataType( " " ) ); assertEquals( " 1", meta.getNativeDataType( " 1 " ) ); meta.setTrimType( ValueMetaInterface.TRIM_TYPE_BOTH ); assertEquals( "", meta.getNativeDataType( "" ) ); assertEquals( "1", meta.getNativeDataType( "1" ) ); assertEquals( "", meta.getNativeDataType( " " ) ); assertEquals( "1", meta.getNativeDataType( " 1 " ) ); }
@Override public Object getNativeDataType( Object object ) throws KettleValueException { return getString( object ); }
ValueMetaString extends ValueMetaBase implements ValueMetaInterface { @Override public Object getNativeDataType( Object object ) throws KettleValueException { return getString( object ); } }
ValueMetaString extends ValueMetaBase implements ValueMetaInterface { @Override public Object getNativeDataType( Object object ) throws KettleValueException { return getString( object ); } ValueMetaString();  ValueMetaString( String name );  ValueMetaString( String name, int length, int precision ); }
ValueMetaString extends ValueMetaBase implements ValueMetaInterface { @Override public Object getNativeDataType( Object object ) throws KettleValueException { return getString( object ); } ValueMetaString();  ValueMetaString( String name );  ValueMetaString( String name, int length, int precision ); @Override Object getNativeDataType( Object object ); @Override Class<?> getNativeDataTypeClass(); }
ValueMetaString extends ValueMetaBase implements ValueMetaInterface { @Override public Object getNativeDataType( Object object ) throws KettleValueException { return getString( object ); } ValueMetaString();  ValueMetaString( String name );  ValueMetaString( String name, int length, int precision ); @Override Object getNativeDataType( Object object ); @Override Class<?> getNativeDataTypeClass();  }