1717import com .fasterxml .jackson .annotation .JsonIgnore ;
1818import java .math .BigInteger ;
1919import java .util .List ;
20+ import java .util .Objects ;
21+
2022import org .fisco .bcos .sdk .utils .Numeric ;
2123
2224public class EventLog {
23- private boolean removed ;
2425 private String logIndex ;
2526 private String transactionIndex ;
2627 private String transactionHash ;
27- private String blockHash ;
2828 private String blockNumber ;
2929 private String address ;
3030 private String data ;
31- private String type ;
3231 private List <String > topics ;
3332
3433 public EventLog () {}
3534
3635 public EventLog (
37- boolean removed ,
3836 String logIndex ,
3937 String transactionIndex ,
4038 String transactionHash ,
41- String blockHash ,
4239 String blockNumber ,
4340 String address ,
4441 String data ,
45- String type ,
4642 List <String > topics ) {
47- this .removed = removed ;
4843 this .logIndex = logIndex ;
4944 this .transactionIndex = transactionIndex ;
5045 this .transactionHash = transactionHash ;
51- this .blockHash = blockHash ;
5246 this .blockNumber = blockNumber ;
5347 this .address = address ;
5448 this .data = data ;
55- this .type = type ;
5649 this .topics = topics ;
5750 }
5851
@@ -61,15 +54,6 @@ public EventLog(String data, List<String> topics) {
6154 this .topics = topics ;
6255 }
6356
64- @ JsonIgnore
65- public boolean isRemoved () {
66- return removed ;
67- }
68-
69- public void setRemoved (boolean removed ) {
70- this .removed = removed ;
71- }
72-
7357 public BigInteger getLogIndex () {
7458 return convert (logIndex );
7559 }
@@ -104,14 +88,6 @@ public void setTransactionHash(String transactionHash) {
10488 this .transactionHash = transactionHash ;
10589 }
10690
107- public String getBlockHash () {
108- return blockHash ;
109- }
110-
111- public void setBlockHash (String blockHash ) {
112- this .blockHash = blockHash ;
113- }
114-
11591 public BigInteger getBlockNumber () {
11692 return convert (blockNumber );
11793 }
@@ -141,15 +117,6 @@ public void setData(String data) {
141117 this .data = data ;
142118 }
143119
144- @ JsonIgnore
145- public String getType () {
146- return type ;
147- }
148-
149- public void setType (String type ) {
150- this .type = type ;
151- }
152-
153120 public List <String > getTopics () {
154121 return topics ;
155122 }
@@ -177,9 +144,6 @@ public boolean equals(Object o) {
177144
178145 EventLog log = (EventLog ) o ;
179146
180- if (isRemoved () != log .isRemoved ()) {
181- return false ;
182- }
183147 if (getLogIndexRaw () != null
184148 ? !getLogIndexRaw ().equals (log .getLogIndexRaw ())
185149 : log .getLogIndexRaw () != null ) {
@@ -195,11 +159,6 @@ public boolean equals(Object o) {
195159 : log .getTransactionHash () != null ) {
196160 return false ;
197161 }
198- if (getBlockHash () != null
199- ? !getBlockHash ().equals (log .getBlockHash ())
200- : log .getBlockHash () != null ) {
201- return false ;
202- }
203162 if (getBlockNumberRaw () != null
204163 ? !getBlockNumberRaw ().equals (log .getBlockNumberRaw ())
205164 : log .getBlockNumberRaw () != null ) {
@@ -213,49 +172,24 @@ public boolean equals(Object o) {
213172 if (getData () != null ? !getData ().equals (log .getData ()) : log .getData () != null ) {
214173 return false ;
215174 }
216- if (getType () != null ? !getType ().equals (log .getType ()) : log .getType () != null ) {
217- return false ;
218- }
219175 return getTopics () != null ? getTopics ().equals (log .getTopics ()) : log .getTopics () == null ;
220176 }
221177
222178 @ Override
223179 public int hashCode () {
224- int result = (isRemoved () ? 1 : 0 );
225- result = 31 * result + (getLogIndexRaw () != null ? getLogIndexRaw ().hashCode () : 0 );
226- result =
227- 31 * result
228- + (getTransactionIndexRaw () != null
229- ? getTransactionIndexRaw ().hashCode ()
230- : 0 );
231- result = 31 * result + (getTransactionHash () != null ? getTransactionHash ().hashCode () : 0 );
232- result = 31 * result + (getBlockHash () != null ? getBlockHash ().hashCode () : 0 );
233- result = 31 * result + (getBlockNumberRaw () != null ? getBlockNumberRaw ().hashCode () : 0 );
234- result = 31 * result + (getAddress () != null ? getAddress ().hashCode () : 0 );
235- result = 31 * result + (getData () != null ? getData ().hashCode () : 0 );
236- result = 31 * result + (getType () != null ? getType ().hashCode () : 0 );
237- result = 31 * result + (getTopics () != null ? getTopics ().hashCode () : 0 );
238- return result ;
180+ return Objects .hash (logIndex , transactionIndex , transactionHash , blockNumber , address , data , topics );
239181 }
240182
241183 @ Override
242184 public String toString () {
243- return "Log [logIndex="
244- + logIndex
245- + ", transactionIndex="
246- + transactionIndex
247- + ", transactionHash="
248- + transactionHash
249- + ", blockHash="
250- + blockHash
251- + ", blockNumber="
252- + blockNumber
253- + ", address="
254- + address
255- + ", data="
256- + data
257- + ", topics="
258- + topics
259- + "]" ;
185+ return "EventLog{" +
186+ "logIndex='" + logIndex + '\'' +
187+ ", transactionIndex='" + transactionIndex + '\'' +
188+ ", transactionHash='" + transactionHash + '\'' +
189+ ", blockNumber='" + blockNumber + '\'' +
190+ ", address='" + address + '\'' +
191+ ", data='" + data + '\'' +
192+ ", topics=" + topics +
193+ '}' ;
260194 }
261195}
0 commit comments