1
我需要比较QuickFIXJ中的两个修复消息(比如两个ExecutionReports)。比较QuickFIXJ中的两个FixMessages
让我们称他们为er1
和er2
现在,我的意思是通过比较它们是一堆领域必须是相同的。例如,我关心标签55,标签207,标签1是相同的。 但不是其他人。
在我看来,这样做的唯一途径是写,因为这是昂贵的(性能明智)的东西:
public static boolean compare(ExecutionReport er1,ExecutionReport er2)
{
StringField sf1 = new StringField(55);
StringField sf2 = new StringField(55);
er.getField(sf1);
er.getField(sf2);
if (sf1.getValue().equals(sf2.getValue())==false) return false;
... // continue with all of the other fields
... // in the same way
}
我缺少的东西? 有人可以提出更好/更快的方法吗?