/** * Creates a shallow copy of the given <code>EventBean</code>. * * @param inBean an <code>EventBean</code> value * @return an <code>EventBean</code> value */ public static EventBean copy(EventBean inBean) { EventBean newBean = new EventBean(); copyAttributes(inBean, newBean); return newBean; } /**
/** * Copies all member attributes from the donor to the recipient. * * @param inDonor an <code>EventBean</code> value * @param inRecipient an <code>EventBean</code> value */ protected static void copyAttributes(EventBean inDonor, EventBean inRecipient) { inRecipient.setMessageId(inDonor.getMessageId()); inRecipient.setSource(inDonor.getSource()); inRecipient.setTimestamp(inDonor.getTimestamp()); inRecipient.setProvider(inDonor.getProvider()); inRecipient.setRequestId(inDonor.getRequestId()); } /**
@Override public long getTimeMillis() { return event.getTimeMillis(); } /* (non-Javadoc)
/** * Create a new TopOfBookImpl instance. * * @param inEvent an <code>EventBean</code> value * @param inInstrument an <code>Instrument</code> value * @param inBid a <code>BidEvent</code> value or <code>null</code> * @param inAsk an <code>AskEvent</code> value or <code>null</code> * @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> */ TopOfBookEventImpl(EventBean inEvent, Instrument inInstrument, BidEvent inBid, AskEvent inAsk) { event = EventBean.copy(inEvent); event.setDefaults(); event.validate(); if(inInstrument == null) { EventServices.error(VALIDATION_NULL_INSTRUMENT); } instrument = inInstrument; bid = inBid; ask = inAsk; } /**
@Override public long getMessageId() { return event.getMessageId(); } /* (non-Javadoc)
@Override public Date getTimestamp() { return event.getTimestamp(); } /* (non-Javadoc)
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof MarketDataBean)) { return false; } MarketDataBean other = (MarketDataBean) obj; return new EqualsBuilder().appendSuper(super.equals(obj)).append(exchange,other.exchange).append(exchangeTimestamp,other.exchangeTimestamp).append(receivedTimestamp,other.receivedTimestamp) .append(processedTimestamp,other.processedTimestamp).append(instrument,other.instrument) .append(price,other.price).append(size,other.size).append(eventType,other.eventType).isEquals(); } /* (non-Javadoc)
/** * Copies all member attributes from the donor to the recipient. * * @param inDonor a <code>MarketDataBean</code> value * @param inRecipient a <code>MarketDataBean</code> value */ protected static void copyAttributes(MarketDataBean inDonor, MarketDataBean inRecipient) { EventBean.copyAttributes(inDonor, inRecipient); inRecipient.setEventType(inDonor.getEventType()); inRecipient.setExchange(inDonor.getExchange()); inRecipient.setExchangeTimestamp(inDonor.getExchangeTimestamp()); inRecipient.setInstrument(inDonor.getInstrument()); inRecipient.setPrice(inDonor.getPrice()); inRecipient.setProcessedTimestamp(inDonor.getProcessedTimestamp()); inRecipient.setReceivedTimestamp(inDonor.getReceivedTimestamp()); inRecipient.setSize(inDonor.getSize()); } /**
@Override public Object getSource() { return event.getSource(); } /* (non-Javadoc)
@Override public String getProvider() { return event.getProvider(); } /* (non-Javadoc)
@Override public long getRequestId() { return event.getRequestId(); } /* (non-Javadoc)
/** * Create a new LogEventImpl instance. * * @param inEvent an <code>EventBean</code> value * @param inLevel a <code>LogEventLevel</code> value * @param inMessage an <code>I18NMessage</code> value * @param inException a <code>Throwable</code> value * @param inParameters a <code>Serializable...</code> value * @throws IllegalArgumentException if <code>MessageId</code> < 0 * @throws IllegalArgumentException if <code>Timestamp</code> is <code>null</code> * @throws IllegalArgumentException if <code>Level</code> is <code>null</code> */ LogEventImpl(EventBean inEvent, LogEventLevel inLevel, I18NMessage inMessage, Throwable inException, Serializable... inParameters) { event = EventBean.copy(inEvent); event.setDefaults(); event.validate(); if(inLevel == null) { EventServices.error(VALIDATION_NULL_LOG_LEVEL); } level = inLevel; message = inMessage; exception = inException; parameters = inParameters; } /**
@Override public long getMessageId() { return event.getMessageId(); } /* (non-Javadoc)
@Override public Date getTimestamp() { return event.getTimestamp(); } /* (non-Javadoc)
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof ImbalanceBean)) { return false; } ImbalanceBean other = (ImbalanceBean)obj; return new EqualsBuilder().append(shortSaleRestricted,other.shortSaleRestricted).append(auctionType,other.auctionType) .append(eventType,other.eventType).append(exchange,other.exchange).append(farPrice,other.farPrice) .append(imbalanceType,other.imbalanceType).append(imbalanceVolume,other.imbalanceVolume).append(instrument,other.instrument) .append(marketStatus,other.marketStatus).append(nearPrice,other.nearPrice).append(pairedVolume,other.pairedVolume) .append(referencePrice,other.referencePrice).isEquals(); } /* (non-Javadoc)
/** * Copies all member attributes from the donor to the recipient. * * @param inDonor a <code>DividendBean</code> value * @param inRecipient a <code>DividendBean</code> value */ protected static void copyAttributes(DividendBean inDonor, DividendBean inRecipient) { EventBean.copyAttributes(inDonor, inRecipient); inRecipient.setEventType(inDonor.getEventType()); inRecipient.setAmount(inDonor.getAmount()); inRecipient.setCurrency(inDonor.getCurrency()); inRecipient.setDeclareDate(inDonor.getDeclareDate()); inRecipient.setEquity(inDonor.getEquity()); inRecipient.setExecutionDate(inDonor.getExecutionDate()); inRecipient.setFrequency(inDonor.getFrequency()); inRecipient.setPaymentDate(inDonor.getPaymentDate()); inRecipient.setRecordDate(inDonor.getRecordDate()); inRecipient.setStatus(inDonor.getStatus()); inRecipient.setType(inDonor.getType()); } /**
@Override public Object getSource() { return event.getSource(); } /* (non-Javadoc)
@Override public String getProvider() { return event.getProvider(); } /* (non-Javadoc)
@Override public long getRequestId() { return event.getRequestId(); } /* (non-Javadoc)
Instrument inInstrument) event = EventBean.copy(inEvent); event.setDefaults(); event.validate(); if(inInstrument == null) { EventServices.error(VALIDATION_NULL_INSTRUMENT);