/** * Creates a shallow copy of the given <code>CurrencyBean</code>. * * @param inBean a <code>CurrencyBean</code> value * @return a <code>CurrencyBean</code> value */ public static CurrencyBean copy(CurrencyBean inBean) { CurrencyBean newBean = new CurrencyBean(); copyAttributes(inBean, newBean); return newBean; } /**
/** * Create a new CurrencyAskEventImpl instance. * * @param inQuote a <code>QuoteBean</code> value * @throws IllegalArgumentException if <code>MessageId</code> < 0 * @throws IllegalArgumentException if <code>Timestamp</code> is <code>null</code> * @throws IllegalArgumentException if <code>Instrument</code> is <code>null</code> * @throws IllegalArgumentException if <code>Price</code> is <code>null</code> * @throws IllegalArgumentException if <code>Size</code> is <code>null</code> * @throws IllegalArgumentException if <code>Exchange</code> is <code>null</code> or empty * @throws IllegalArgumentException if <code>ExchangeTimestamp</code> is <code>null</code> or empty * @throws IllegalArgumentException if <code>Action</code> is <code>null</code> */ CurrencyAskEventImpl(QuoteBean inQuote, CurrencyBean inCurrency) { super(inQuote); currency = CurrencyBean.copy(inCurrency); currency.validate(); } /**
/** * 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()); }
/** * 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; } /**
@Override public int getContractSize() { return currency.getContractSize(); } /**
@Override public DeliveryType getDeliveryType() { return currency.getDeliveryType(); } /* (non-Javadoc)
/** * Create a new CurrencyBidEventImpl instance. * * <p>This constructor is intended to be used by JAXB only. */ @SuppressWarnings("unused") private CurrencyBidEventImpl() { currency = new CurrencyBean(); } /**
/** * 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; } /**
CurrencyBean currency = CurrencyBean.getCurrencyBeanFromEvent((CurrencyEvent)inEvent); if(inEvent instanceof AskEvent) { return new CurrencyAskEventImpl(quote,
@Override public int getContractSize() { return currency.getContractSize(); } /**
@Override public DeliveryType getDeliveryType() { return currency.getDeliveryType(); } /**
/** * Create a new CurrencyTradeEventImpl instance. * * <p>This constructor is intended to be used by JAXB only. */ @SuppressWarnings("unused") private CurrencyTradeEventImpl() { currency = new CurrencyBean(); } /**
/** * 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; } /**
CurrencyBean currency = CurrencyBean.getCurrencyBeanFromEvent((CurrencyEvent)inEvent); if(inEvent instanceof AskEvent) { return (E)new CurrencyAskEventImpl(quote,
/** * Create a new CurrencyBidEventImpl instance. * * @param inQuote a <code>QuoteBean</code> value * @throws IllegalArgumentException if <code>MessageId</code> < 0 * @throws IllegalArgumentException if <code>Timestamp</code> is <code>null</code> * @throws IllegalArgumentException if <code>Instrument</code> is <code>null</code> * @throws IllegalArgumentException if <code>Price</code> is <code>null</code> * @throws IllegalArgumentException if <code>Size</code> is <code>null</code> * @throws IllegalArgumentException if <code>Exchange</code> is <code>null</code> or empty * @throws IllegalArgumentException if <code>ExchangeTimestamp</code> is <code>null</code> or empty * @throws IllegalArgumentException if <code>Action</code> is <code>null</code> */ CurrencyBidEventImpl(QuoteBean inQuote, CurrencyBean inCurrency) { super(inQuote); currency = CurrencyBean.copy(inCurrency); currency.validate(); } /* (non-Javadoc)
@Override public int getContractSize() { return currency.getContractSize(); } /* (non-Javadoc)
@Override public DeliveryType getDeliveryType() { return currency.getDeliveryType(); } /* (non-Javadoc)
/** * Create a new CurrencyMarketstatEventImpl instance. * * <p>This constructor is intended to be used by JAXB only. */ @SuppressWarnings("unused") private CurrencyMarketstatEventImpl() { currency = new CurrencyBean(); } /**
/** * 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; } /**
CurrencyBean currency = CurrencyBean.getCurrencyBeanFromEvent((CurrencyEvent)inEvent); if(inEvent instanceof AskEvent) { return (E)new CurrencyAskEventImpl(quote,