package org.apache.phoenix.example.bean; import java.util.Arrays; public final class StockBean { private String stockName; private Integer year; private double[] recordings; private double average; public String getStockName() { return stockName; } public void setStockName(String stockName) { this.stockName = stockName; } public Integer getYear() { return year; } public void setYear(Integer year) { this.year = year; } public double[] getRecordings() { return recordings; } public void setRecordings(double[] recordings) { this.recordings = recordings; } public double getAverage() { return average; } public void setAverage(double average) { this.average = average; } @Override public int hashCode() { final int prime = 31; int result = 1; long temp; temp = Double.doubleToLongBits(average); result = prime * result + (int)(temp ^ (temp >>> 32)); result = prime * result + Arrays.hashCode(recordings); result = prime * result + ((stockName == null) ? 0 : stockName.hashCode()); result = prime * result + ((year == null) ? 0 : year.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; StockBean other = (StockBean)obj; if (Double.doubleToLongBits(average) != Double.doubleToLongBits(other.average)) return false; if (!Arrays.equals(recordings, other.recordings)) return false; if (stockName == null) { if (other.stockName != null) return false; } else if (!stockName.equals(other.stockName)) return false; if (year == null) { if (other.year != null) return false; } else if (!year.equals(other.year)) return false; return true; } }