[QFJ-428] FieldMap.setField(int key, Field<?> field) should be public Created: 06/Apr/09  Updated: 16/Nov/18  Resolved: 06/Apr/10

Status: Closed
Project: QuickFIX/J
Component/s: Metadata/Specs
Affects Version/s: 1.4.0
Fix Version/s: 1.5.0

Type: Improvement Priority: Default
Reporter: Paul-Henri Giraud Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
is related to QFJ-962 FieldMap.setField(int key, Field<?> f... Open

 Description   

Application that need to write data in FieldMap (Message, Groups) in a generic way need to have a public access to FieldMap.setField(int key, Field<?> field).

FieldMap dest;
final Field<?> field;

This will allow writing :

dest.setField(field.getField(), field);

Instead of:

if (field instanceof StringField)

{ dest.setField((StringField) field); }

else if (field instanceof IntField)

{ dest.setField((IntField) field); }

else if (field instanceof CharField)

{ dest.setField((CharField) field); }

else if (field instanceof DecimalField)

{ dest.setField((DecimalField) field); }

else if (field instanceof DoubleField)

{ dest.setField((DoubleField) field); }

else if (field instanceof UtcDateOnlyField)

{ dest.setField((UtcDateOnlyField) field); }

else if (field instanceof UtcTimeOnlyField)

{ dest.setField((UtcTimeOnlyField) field); }

else if (field instanceof UtcTimeStampField)

{ dest.setField((UtcTimeStampField) field); }

else if (field instanceof BooleanField)

{ dest.setField((BooleanField) field); }

else

{ throw new RuntimeException("Unhandled field type: " + field.getClass()); }
Generated at Sat Nov 23 04:11:29 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.