1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.primefaces.extensions.model.sheet;
23
24 import java.io.Serializable;
25 import java.util.Objects;
26
27
28
29
30
31
32
33 public class SheetUpdate implements Serializable {
34
35 private static final long serialVersionUID = 1L;
36
37 private final transient Object rowData;
38
39 private final transient Object oldValue;
40
41 private final transient Object newValue;
42
43 private final transient Object rowKey;
44
45 private final int colIndex;
46
47 private transient String toString;
48
49 private transient int hashCode;
50
51
52
53
54
55
56
57
58
59
60 public SheetUpdate(Object rowKey, int colIndex, Object rowData,
61 Object oldValue, Object newValue) {
62 this.rowKey = rowKey;
63 this.colIndex = colIndex;
64 this.rowData = rowData;
65 this.oldValue = oldValue;
66 this.newValue = newValue;
67 }
68
69 @Override
70 public int hashCode() {
71 if (hashCode == 0) {
72 hashCode = 7;
73 hashCode = 73 * hashCode + Objects.hashCode(rowKey);
74 hashCode = 73 * hashCode + colIndex;
75 }
76 return hashCode;
77 }
78
79 @Override
80 public boolean equals(Object obj) {
81 if (this == obj) {
82 return true;
83 }
84 if (obj == null) {
85 return false;
86 }
87 if (getClass() != obj.getClass()) {
88 return false;
89 }
90 final SheetUpdate other = (SheetUpdate) obj;
91 if (colIndex != other.colIndex) {
92 return false;
93 }
94 if (!Objects.equals(rowKey, other.rowKey)) {
95 return false;
96 }
97 return true;
98 }
99
100 @Override
101 public String toString() {
102 if (toString == null) {
103 toString = "SheetUpdate{" + "rowData=" + rowData + ", oldValue=" + oldValue
104 + ", newValue=" + newValue + ", rowKey=" + rowKey + ", colIndex=" + colIndex + '}';
105 }
106 return toString;
107 }
108
109
110
111
112
113
114 public Object getRowData() {
115 return rowData;
116 }
117
118
119
120
121
122
123 public Object getOldValue() {
124 return oldValue;
125 }
126
127
128
129
130
131
132 public Object getNewValue() {
133 return newValue;
134 }
135
136
137
138
139
140
141 public Object getRowKey() {
142 return rowKey;
143 }
144
145
146
147
148
149
150 public int getColIndex() {
151 return colIndex;
152 }
153
154 }