/* * Copyright 2010-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.amqp.support.converter; import java.math.BigDecimal; public class SimpleTrade { private String ticker; private long quantity; private BigDecimal price; private String orderType; private String accountName; private boolean buyRequest; private String userName; private String requestId; public String getTicker() { return ticker; } public void setTicker(String ticker) { this.ticker = ticker; } public long getQuantity() { return quantity; } public void setQuantity(long quantity) { this.quantity = quantity; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public String getOrderType() { return orderType; } public void setOrderType(String orderType) { this.orderType = orderType; } public String getAccountName() { return accountName; } public void setAccountName(String accountName) { this.accountName = accountName; } public boolean isBuyRequest() { return buyRequest; } public void setBuyRequest(boolean buyRequest) { this.buyRequest = buyRequest; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getRequestId() { return requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((accountName == null) ? 0 : accountName.hashCode()); result = prime * result + (buyRequest ? 1231 : 1237); result = prime * result + ((orderType == null) ? 0 : orderType.hashCode()); result = prime * result + ((price == null) ? 0 : price.hashCode()); result = prime * result + (int) (quantity ^ (quantity >>> 32)); result = prime * result + ((requestId == null) ? 0 : requestId.hashCode()); result = prime * result + ((ticker == null) ? 0 : ticker.hashCode()); result = prime * result + ((userName == null) ? 0 : userName.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } SimpleTrade other = (SimpleTrade) obj; if (accountName == null) { if (other.accountName != null) { return false; } } else if (!accountName.equals(other.accountName)) { return false; } if (buyRequest != other.buyRequest) { return false; } if (orderType == null) { if (other.orderType != null) { return false; } } else if (!orderType.equals(other.orderType)) { return false; } if (price == null) { if (other.price != null) { return false; } } else if (!price.equals(other.price)) { return false; } if (quantity != other.quantity) { return false; } if (requestId == null) { if (other.requestId != null) { return false; } } else if (!requestId.equals(other.requestId)) { return false; } if (ticker == null) { if (other.ticker != null) { return false; } } else if (!ticker.equals(other.ticker)) { return false; } if (userName == null) { if (other.userName != null) { return false; } } else if (!userName.equals(other.userName)) { return false; } return true; } }