/** * Creates a shallow copy of the given <code>MarketstatBean</code>. * * @param inBean a <code>MarketstatBean</code> value * @return a <code>MarketstatBean</code> value */ public static MarketstatBean copy(MarketstatBean inBean) { MarketstatBean newBean = new MarketstatBean(); copyAttributes(inBean, newBean); return newBean; } /**
/** * Create a new AbstractMarketstatEventImpl instance. * * @param inMarketstatBean a <code>MarketstatBean</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> */ protected AbstractMarketstatEventImpl(MarketstatBean inMarketstat) { marketstat = MarketstatBean.copy(inMarketstat); marketstat.setDefaults(); marketstat.validate(); } /**
@Override public BigDecimal getClose() { return marketstat.getClose(); } /* (non-Javadoc)
/** * Copies all member attributes from the donor to the recipient. * * @param inDonor a <code>MarketstatBean</code> value * @param inRecipient a <code>MarketstatBean</code> value */ protected static void copyAttributes(MarketstatBean inDonor, MarketstatBean inRecipient) { EventBean.copyAttributes(inDonor, inRecipient); inRecipient.setEventType(inDonor.getEventType()); inRecipient.setClose(inDonor.getClose()); inRecipient.setCloseDate(inDonor.getCloseDate()); inRecipient.setCloseExchange(inDonor.getCloseExchange()); inRecipient.setHigh(inDonor.getHigh()); inRecipient.setHighExchange(inDonor.getHighExchange()); inRecipient.setInstrument(inDonor.getInstrument()); inRecipient.setLow(inDonor.getLow()); inRecipient.setLowExchange(inDonor.getLowExchange()); inRecipient.setOpen(inDonor.getOpen()); inRecipient.setOpenExchange(inDonor.getOpenExchange()); inRecipient.setPreviousClose(inDonor.getPreviousClose()); inRecipient.setPreviousCloseDate(inDonor.getPreviousCloseDate()); inRecipient.setTradeHighTime(inDonor.getTradeHighTime()); inRecipient.setTradeLowTime(inDonor.getTradeLowTime()); inRecipient.setVolume(inDonor.getVolume()); inRecipient.setValue(inDonor.getValue()); } /**
@Override public Instrument getInstrument() { return marketstat.getInstrument(); } /* (non-Javadoc)
@Override public BigDecimal getHigh() { return marketstat.getHigh(); } /* (non-Javadoc)
/** * Create a new AbstractMarketstatEventImpl instance. * * <p>This constructor is intended to be used by JAXB only. */ protected AbstractMarketstatEventImpl() { marketstat = new MarketstatBean(); } /**
@Override public String getCloseDate() { return marketstat.getCloseDate(); } /* (non-Javadoc)
@Override public String getCloseExchange() { return marketstat.getCloseExchange(); } /* (non-Javadoc)
@Override public String getHighExchange() { return marketstat.getHighExchange(); } /* (non-Javadoc)
@Override public EventType getEventType() { return marketstat.getEventType(); } /* (non-Javadoc)
@Override public MarketstatEvent create() { if(!(getMarketstat().getInstrument() instanceof Equity)) { throw new IllegalArgumentException(VALIDATION_EQUITY_REQUIRED.getText()); } return new EquityMarketstatEventImpl(getMarketstat()); } };
@Override public MarketstatEvent create() { if(!(getMarketstat().getInstrument() instanceof Currency)) { throw new IllegalArgumentException(VALIDATION_CURRENCY_REQUIRED.getText()); } return new CurrencyMarketstatEventImpl(getMarketstat(),getCurrency()); } };
@Override public MarketstatEvent create() { if(!(getMarketstat().getInstrument() instanceof ConvertibleBond)) { throw new IllegalArgumentException(VALIDATION_BOND_REQUIRED.getText()); } return new ConvertibleBondMarketstatEventImpl(getMarketstat(), getConvertibleBond()); } };
@Override public MarketstatEvent create() { if(!(getMarketstat().getInstrument() instanceof Future)) { throw new IllegalArgumentException(VALIDATION_FUTURE_REQUIRED.getText()); } return new FutureMarketstatEventImpl(getMarketstat(), getFuture()); } };
@Override public MarketstatEvent create() { if(!(getMarketstat().getInstrument() instanceof Option)) { throw new IllegalArgumentException(VALIDATION_OPTION_REQUIRED.getText()); } return new OptionMarketstatEventImpl(getMarketstat(), getOption(), getVolumeChange(), getInterestChange()); } };