/** * Builds a <code>CurrencyBean</code> based on the values of * the given event. * * @param inCurrencyEvent a <code>CurrencyEvent</code> value * @return a <code>CurrencyBean</code> value */ public static CurrencyBean getCurrencyBeanFromEvent(CurrencyEvent inCurrencyEvent) { CurrencyBean currency = new CurrencyBean(); currency.setInstrument(inCurrencyEvent.getInstrument()); //ToDo Set appropriate properties return currency; } /**
/** * Sets the instrument value. * * @param inInstrument an <code>Instrument</code> value or <code>null</code> * @return a <code>ImbalanceEventBuilder</code> value */ public final ImbalanceEventBuilder withInstrument(Instrument inInstrument) { imbalance.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; } /**
/** * Sets the instrument value. * * @param inInstrument an <code>Instrument</code> value or <code>null</code> * @return a <code>QuoteEventBuilder<E></code> value */ public QuoteEventBuilder<E> withInstrument(Instrument inInstrument) { quote.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; } /**
/** * Sets the instrument value. * * @param inInstrument an <code>Instrument</code> value or <code>null</code> * @return a <code>MarketstatEventBuilder</code> value */ public final MarketstatEventBuilder withInstrument(Instrument inInstrument) { marketstat.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; } /**
/** * Copies all member attributes from the donor to the recipient. * * @param inDonor an <code>CurrencyBean</code> value * @param inRecipient an <code>CurrencyBean</code> value */ protected static void copyAttributes(CurrencyBean inDonor, CurrencyBean inRecipient) { inRecipient.setDeliveryType(inDonor.getDeliveryType()); inRecipient.setInstrument(inDonor.getInstrument()); inRecipient.setContractSize(inDonor.getContractSize()); }
/** * 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; } /**