public static void fromFudgeMsg( FudgeDeserializer deserializer, FudgeMsg msg, FXOptionSecurity object) { FinancialSecurityFudgeBuilder.fromFudgeMsg(deserializer, msg, object); object.setPutCurrency(msg.getValue(Currency.class, PUT_CURRENCY_FIELD_NAME)); object.setCallCurrency(msg.getValue(Currency.class, CALL_CURRENCY_FIELD_NAME)); object.setPutAmount(msg.getDouble(PUT_AMOUNT_FIELD_NAME)); object.setCallAmount(msg.getDouble(CALL_AMOUNT_FIELD_NAME)); object.setExpiry( ExpiryFudgeBuilder.fromFudgeMsg(deserializer, msg.getMessage(EXPIRY_FIELD_NAME))); object.setSettlementDate( ZonedDateTimeFudgeBuilder.fromFudgeMsg( deserializer, msg.getMessage(SETTLEMENT_DATE_FIELD_NAME))); object.setLongShort(LongShort.ofLong(msg.getBoolean(IS_LONG_FIELD_NAME))); }
public static void toFudgeMsg( FudgeSerializer serializer, FXOptionSecurity object, final MutableFudgeMsg msg) { FinancialSecurityFudgeBuilder.toFudgeMsg(serializer, object, msg); addToMessage(msg, PUT_CURRENCY_FIELD_NAME, object.getPutCurrency()); addToMessage(msg, CALL_CURRENCY_FIELD_NAME, object.getCallCurrency()); addToMessage(msg, PUT_AMOUNT_FIELD_NAME, object.getPutAmount()); addToMessage(msg, CALL_AMOUNT_FIELD_NAME, object.getCallAmount()); addToMessage( msg, EXPIRY_FIELD_NAME, ExpiryFudgeBuilder.toFudgeMsg(serializer, object.getExpiry())); addToMessage( msg, SETTLEMENT_DATE_FIELD_NAME, ZonedDateTimeFudgeBuilder.toFudgeMsg(serializer, object.getSettlementDate())); addToMessage(msg, IS_LONG_FIELD_NAME, object.isLong()); }