public double getD() { return bit_reader.getDoubleValue( object ); }
@Test public void testGetIntValue() { assertEquals( IntClassFieldExtractorTest.VALUE, this.reader.getIntValue( null, this.bean ) ); }
public String getName() { // return object.getName(); return (String) name_reader.getValue(object); }
val = name_reader.getValue( object ); name_writer.setValue( object, null ); return val; val = bit_reader.getIntValue( object ); bit_writer.setIntValue( object, 0 ); return val;
extractName.getValue( null, stilton ) ); extractPrice.getValue( null, stilton ) ); assertFalse( extractName.isNullValue( null, stilton ) ); assertTrue( extractName.isNullValue( null, stilton ) ); assertFalse( extractPrice.isNullValue( null, stilton ) ); extractName.getValue( null, brie ) ); extractPrice.getValue( null, brie ) ); assertFalse( extractName.isNullValue( null, brie ) ); assertTrue( extractName.isNullValue( null, brie ) ); assertFalse( extractPrice.isNullValue( null, stilton ) );
@Test public void testGetLongValue() { assertEquals((long) FloatClassFieldExtractorTest.VALUE, this.reader.getLongValue(null, this.bean)); }
@Test public void testGetByteValue() { assertEquals((byte) DoubleClassFieldExtractorTest.VALUE, this.reader.getByteValue(null, this.bean)); }
@Test public void testGetCharValue() { try { this.reader.getCharValue( null, this.bean ); fail( "Should have throw an exception" ); } catch ( final Exception e ) { // success } }
@Test public void testGetFloatValue() { assertEquals( IntClassFieldExtractorTest.VALUE, this.reader.getFloatValue( null, this.bean ), 0.01 ); }
@Test public void testGetBooleanValue() { try { this.reader.getBooleanValue( null, this.bean ); fail( "Should have throw an exception" ); } catch ( final Exception e ) { // success } }
@Test public void testDeclarationsObjectType() throws Exception { final ObjectType type = new ClassObjectType( Cheese.class ); final Pattern col = new Pattern( 0, type, "foo" ); final Declaration dec = col.getDeclaration(); final InternalReadAccessor ext = dec.getExtractor(); assertEquals( Cheese.class, ext.getExtractToClass() ); final Cheese stilton = new Cheese( "stilton", 42 ); assertEquals( stilton, dec.getValue( null, stilton ) ); }
public Object remove(Object key) { Object val; // any hard field must be 0-fied // any soft field must be 0-fied on the map // other fields will effectively be removed if ( "name".equals( key ) ) { val = name_reader.getValue( object ); name_writer.setValue( object, null ); return val; } if ( "bol".equals( key ) ) { val = bit_reader.getIntValue( object ); bit_writer.setIntValue( object, 0 ); return val; } if ( "age".equals( key ) ) { val = this.store.get( propertyKey( "age" ) ); super.put( "age", 0 ); return val; } val = super.remove( key ); return val; }
@Test public void testGetLongValue() { assertEquals(1, this.reader.getLongValue(null, this.bean)); }
@Test public void testGetByteValue() { try { this.reader.getByteValue( null, this.bean ); fail( "Should have throw an exception" ); } catch ( final Exception e ) { // success } }
@Test public void testGetCharValue() { assertEquals('a', this.reader.getCharValue(null, this.bean)); }
@Test public void testGetFloatValue() { assertEquals( ShortClassFieldExtractorTest.VALUE, this.reader.getFloatValue( null, this.bean ), 0.01 ); }
@Test public void testGetBooleanValue() { assertTrue(this.reader.getBooleanValue(null, this.bean)); }