forked from tronprotocol/java-tron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItem.java
More file actions
36 lines (29 loc) · 702 Bytes
/
Item.java
File metadata and controls
36 lines (29 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package org.tron.core.net.node;
import lombok.Getter;
import org.tron.common.utils.Sha256Hash;
import org.tron.protos.Protocol.Inventory.InventoryType;
@Getter
public class Item {
private Sha256Hash hash;
private InventoryType type;
public Item(Sha256Hash hash, InventoryType type) {
this.hash = hash;
this.type = type;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || this.getClass() != o.getClass()) {
return false;
}
Item item = (Item) o;
return hash.equals(item.getHash()) &&
type.equals(item.getType());
}
@Override
public int hashCode() {
return hash.hashCode();
}
}