Coverage Summary for Class: BlockHeaderElement (co.rsk.metrics)
Class |
Class, %
|
Method, %
|
Line, %
|
BlockHeaderElement |
0%
(0/1)
|
0%
(0/5)
|
0%
(0/14)
|
1 /*
2 * This file is part of RskJ
3 * Copyright (C) 2017 RSK Labs Ltd.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 package co.rsk.metrics;
20
21 import co.rsk.core.BlockDifficulty;
22 import org.ethereum.core.BlockHeader;
23
24 import java.util.Objects;
25
26 /**
27 * Created by mario on 09/09/2016.
28 */
29 public class BlockHeaderElement {
30
31 private final BlockHeader blockHeader;
32 private final BlockDifficulty difficulty;
33
34 public BlockHeaderElement(BlockHeader blockHeader, BlockDifficulty difficulty) {
35 this.blockHeader = blockHeader;
36 this.difficulty = difficulty;
37 }
38
39 public BlockHeader getBlockHeader() {
40 return blockHeader;
41 }
42
43 public BlockDifficulty getDifficulty() {
44 return difficulty;
45 }
46
47 @Override
48 public boolean equals(Object o) {
49 if (this == o) {
50 return true;
51 }
52
53 if (o == null || getClass() != o.getClass()) {
54 return false;
55 }
56
57 BlockHeaderElement that = (BlockHeaderElement) o;
58
59 return Objects.equals(blockHeader, that.blockHeader) &&
60 Objects.equals(difficulty, that.difficulty);
61 }
62
63 @Override
64 public int hashCode() {
65 return Objects.hash(blockHeader, difficulty);
66 }
67 }