@Override
public FixedIncomeStrip buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
final StripInstrumentType type = deserializer.fieldValueToObject(StripInstrumentType.class, message.getByName(TYPE));
final String conventionName = message.getString(CONVENTION_NAME);
final Tenor tenor = deserializer.fieldValueToObject(Tenor.class, message.getByName(TENOR));
if (type == StripInstrumentType.FUTURE) {
final int numFutures = message.getInt(NUM_FUTURES);
return new FixedIncomeStrip(type, tenor, numFutures, conventionName);
} else if (type == StripInstrumentType.PERIODIC_ZERO_DEPOSIT) {
final int periodsPerYear = message.getInt(PERIODS_PER_YEAR);
return new FixedIncomeStrip(type, tenor, periodsPerYear, true, conventionName);
} else if (message.hasField(RESET_TENOR)) {
final Tenor resetTenor = deserializer.fieldValueToObject(Tenor.class, message.getByName(RESET_TENOR));
final IndexType indexType = deserializer.fieldValueToObject(IndexType.class, message.getByName(INDEX_TYPE));
return new FixedIncomeStrip(type, tenor, resetTenor, indexType, conventionName);
} else if (type == StripInstrumentType.BASIS_SWAP) {
final Tenor payTenor = deserializer.fieldValueToObject(Tenor.class, message.getByName(PAY_TENOR));
final Tenor receiveTenor = deserializer.fieldValueToObject(Tenor.class, message.getByName(RECEIVE_TENOR));
final IndexType payIndexType = deserializer.fieldValueToObject(IndexType.class, message.getByName(PAY_INDEX_TYPE));
final IndexType receiveIndexType = deserializer.fieldValueToObject(IndexType.class, message.getByName(RECEIVE_INDEX_TYPE));
return new FixedIncomeStrip(type, tenor, payTenor, receiveTenor, payIndexType, receiveIndexType, conventionName);
} else {
return new FixedIncomeStrip(type, tenor, conventionName);