String.class );
final FieldTemplate cheesePrice = new FieldTemplateImpl( "price",
1,
Integer.class );
final FieldTemplate[] fields = new FieldTemplate[]{cheeseName, cheesePrice};
final FactTemplate cheese = new FactTemplateImpl( pkg,
"Cheese",
fields );
final ObjectType type = new FactTemplateObjectType( cheese );
final Pattern col = new Pattern( 0,
type,
"foo" );
final Declaration dec = col.getDeclaration();
final InternalReadAccessor ext = dec.getExtractor();
assertEquals( Fact.class,
ext.getExtractToClass() );
final Fact stilton = cheese.createFact( 10 );
stilton.setFieldValue( "name",
"stilton" );
stilton.setFieldValue( "price",
new Integer( 200 ) );