/** * Copies all member attributes from the donor to the recipient. * * @param inDonor an <code>OptionBean</code> value * @param inRecipient an <code>OptionBean</code> value */ protected static void copyAttributes(OptionBean inDonor, OptionBean inRecipient) { inRecipient.setExpirationType(inDonor.getExpirationType()); inRecipient.setHasDeliverable(inDonor.hasDeliverable()); inRecipient.setInstrument(inDonor.getInstrument()); inRecipient.setMultiplier(inDonor.getMultiplier()); inRecipient.setProviderSymbol(inDonor.getProviderSymbol()); inRecipient.setUnderlyingInstrument(inDonor.getUnderlyingInstrument()); } /**
/** * Builds an <code>OptionBean</code> based on the values of * the given event. * * @param inOptionEvent an <code>OptionEvent</code> value * @return an <code>OptionBean</code> value */ public static OptionBean getOptionBeanFromEvent(OptionEvent inOptionEvent) { OptionBean option = new OptionBean(); option.setExpirationType(inOptionEvent.getExpirationType()); option.setHasDeliverable(inOptionEvent.hasDeliverable()); option.setInstrument(inOptionEvent.getInstrument()); option.setMultiplier(inOptionEvent.getMultiplier()); option.setUnderlyingInstrument(inOptionEvent.getUnderlyingInstrument()); option.setProviderSymbol(inOptionEvent.getProviderSymbol()); return option; } /**
option.setInstrument(new Option(inInstrument.getSymbol(), inInstrument.getExpiry(), inInstrument.getStrikePrice(), inType)); option.setUnderlyingInstrument(inUnderlyingInstrument); option.setExpirationType(inExpirationType); option.setHasDeliverable(inHasDeliverable); option.setMultiplier(inMultiplier); option.validate(); providerSymbol = StringUtils.trimToNull(inProviderSymbol);
@Override public Instrument getUnderlyingInstrument() { return option.getUnderlyingInstrument(); } /* (non-Javadoc)
@Override public BigDecimal getMultiplier() { return option.getMultiplier(); } /* (non-Javadoc)
@Override public ExpirationType getExpirationType() { return option.getExpirationType(); } /* (non-Javadoc)
@Override public boolean hasDeliverable() { return option.hasDeliverable(); } /* (non-Javadoc)
/** * Sets the hasDeliverable value. * * @param inHasDeliverable a <code>boolean</code> value * @return a <code>QuoteEventBuilder<E></code> value */ public QuoteEventBuilder<E> hasDeliverable(boolean inHasDeliverable) { option.setHasDeliverable(inHasDeliverable); return this; } /**
/** * Sets the underlyingInstrument value. * * @param inUnderlyingInstrument an <code>Instrument</code> value or <code>null</code> * @return a <code>ImbalanceEventBuilder</code> value */ public final ImbalanceEventBuilder withUnderlyingInstrument(Instrument inUnderlyingInstrument) { option.setUnderlyingInstrument(inUnderlyingInstrument); return this; } /**
/** * Sets the multiplier value. * * @param inMultiplier a <code>BigDecimal</code> value * @return a <code>MarketstatEventBuilder</code> value */ public final MarketstatEventBuilder withMultiplier(BigDecimal inMultiplier) { option.setMultiplier(inMultiplier); return this; } /**
/** * Sets the expirationType value. * * @param inExpirationType an <code>ExpirationType</code> value or <code>null</code> * @return a <code>QuoteEventBuilder<E></code> value */ public QuoteEventBuilder<E> withExpirationType(ExpirationType inExpirationType) { option.setExpirationType(inExpirationType); return this; } /**
/** * Sets the instrument value. * * @param inInstrument an <code>Instrument</code> value or <code>null</code> * @return a <code>TradeEventBuilder</code> value */ public TradeEventBuilder<E> withInstrument(Instrument inInstrument) { tradeData.setInstrument(inInstrument); if(inInstrument instanceof Option) { option.setInstrument((Option)inInstrument); } else if(inInstrument instanceof Future) { future.setInstrument((Future)inInstrument); } else if(inInstrument instanceof Currency) { currency.setInstrument((Currency)inInstrument); } else if(inInstrument instanceof ConvertibleBond) { convertibleBond.setInstrument((ConvertibleBond)inInstrument); } if(inInstrument == null) { option.setInstrument(null); future.setInstrument(null); currency.setInstrument(null); convertibleBond.setInstrument(null); } return this; } /**
@Override public Option getInstrument() { return option.getInstrument(); } /* (non-Javadoc)
@Override public Instrument getUnderlyingInstrument() { return option.getUnderlyingInstrument(); } /* (non-Javadoc)
@Override public BigDecimal getMultiplier() { return option.getMultiplier(); } /* (non-Javadoc)
@Override public ExpirationType getExpirationType() { return option.getExpirationType(); } /* (non-Javadoc)
/** * Get the hasDeliverable value. * * @return a <code>boolean</code> value */ public boolean hasDeliverable() { return option.hasDeliverable(); } /**
/** * Sets the hasDeliverable value. * * @param inHasDeliverable a <code>boolean</code> value * @return a <code>ImbalanceEventBuilder</code> value */ public final ImbalanceEventBuilder hasDeliverable(boolean inHasDeliverable) { option.setHasDeliverable(inHasDeliverable); return this; } /**
/** * Sets the underlyingInstrument value. * * @param inUnderlyingInstrument an <code>Instrument</code> value or <code>null</code> * @return a <code>QuoteEventBuilder<E></code> value */ public QuoteEventBuilder<E> withUnderlyingInstrument(Instrument inUnderlyingInstrument) { option.setUnderlyingInstrument(inUnderlyingInstrument); return this; } /**
/** * Sets the multiplier value. * * @param inMultiplier a <code>BigDecimal</code> value * @return a <code>QuoteEventBuilder<E></code> value */ public QuoteEventBuilder<E> withMultiplier(BigDecimal inMultiplier) { option.setMultiplier(inMultiplier); return this; } /**