@Override public IndexON buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) { final String name = message.getString(NAME_FIELD); final Currency currency = Currency.of(message.getString(CURRENCY_FIELD)); final DayCount dayCount = DayCountFactory.INSTANCE.getDayCount(message.getString(DAY_COUNT_FIELD)); final int publicationLag = message.getInt(PUBLICATION_LAG_FIELD); return new IndexON(name, currency, dayCount, publicationLag); }
@Override public IborIndex buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) { final Currency currency = Currency.of(message.getString(CURRENCY_FIELD)); final int spotLag = message.getInt(SPOT_LAG_FIELD); final DayCount dayCount = DayCountFactory.INSTANCE.getDayCount(message.getString(DAY_COUNT_FIELD)); final BusinessDayConvention businessDayConvention = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention( message.getString(BUSINESS_DAY_CONVENTION_FIELD)); final boolean isEOM = message.getBoolean(EOM_FIELD); final Period tenor = Period.parse(message.getString(TENOR_FIELD)); final String name = message.getString(NAME_FIELD); return new IborIndex(currency, tenor, spotLag, dayCount, businessDayConvention, isEOM, name); }
@Override public FixedIncomeStripWithSecurity buildObject( FudgeDeserializationContext context, FudgeMsg message) { StripInstrumentType type = context.fieldValueToObject(StripInstrumentType.class, message.getByName("type")); Tenor tenor = context.fieldValueToObject(Tenor.class, message.getByName("tenor")); Tenor resolvedTenor = context.fieldValueToObject(Tenor.class, message.getByName("resolvedTenor")); ZonedDateTimeBuilder zonedDateTimeBuilder = new ZonedDateTimeBuilder(); ZonedDateTime maturity = zonedDateTimeBuilder.buildObject(context, message.getMessage("maturity")); Identifier identifier = context.fieldValueToObject(Identifier.class, message.getByName("identifier")); Security security = (Security) context.fieldValueToObject(message.getByName("security")); if (type == StripInstrumentType.FUTURE) { int numFutures = message.getInt("numFutures"); return new FixedIncomeStripWithSecurity( type, tenor, resolvedTenor, numFutures, maturity, identifier, security); } else { return new FixedIncomeStripWithSecurity( type, tenor, resolvedTenor, maturity, identifier, security); } }