1 | package org.cardanofoundation.explorer.api.mapper; | |
2 | ||
3 | import java.sql.Timestamp; | |
4 | import javax.annotation.processing.Generated; | |
5 | import org.cardanofoundation.explorer.api.model.response.TxFilterResponse; | |
6 | import org.cardanofoundation.explorer.api.model.response.tx.TxInfoResponse; | |
7 | import org.cardanofoundation.explorer.api.model.response.tx.TxResponse; | |
8 | import org.cardanofoundation.explorer.common.entity.ledgersync.Block; | |
9 | import org.cardanofoundation.explorer.common.entity.ledgersync.Tx; | |
10 | import org.springframework.stereotype.Component; | |
11 | ||
12 | @Generated( | |
13 | value = "org.mapstruct.ap.MappingProcessor", | |
14 | date = "2024-11-05T06:00:27+0000", | |
15 | comments = "version: 1.5.3.Final, compiler: javac, environment: Java 18.0.2.1 (Eclipse Adoptium)" | |
16 | ) | |
17 | @Component | |
18 | public class TxMapperImpl implements TxMapper { | |
19 | ||
20 | @Override | |
21 | public TxFilterResponse txToTxFilterResponse(Tx tx) { | |
22 |
1
1. txToTxFilterResponse : negated conditional → NO_COVERAGE |
if ( tx == null ) { |
23 | return null; | |
24 | } | |
25 | ||
26 | TxFilterResponse txFilterResponse = new TxFilterResponse(); | |
27 | ||
28 |
1
1. txToTxFilterResponse : removed call to org/cardanofoundation/explorer/api/model/response/TxFilterResponse::setEpochNo → NO_COVERAGE |
txFilterResponse.setEpochNo( txBlockEpochNo( tx ) ); |
29 |
1
1. txToTxFilterResponse : removed call to org/cardanofoundation/explorer/api/model/response/TxFilterResponse::setEpochSlotNo → NO_COVERAGE |
txFilterResponse.setEpochSlotNo( txBlockEpochSlotNo( tx ) ); |
30 | Long slotNo = txBlockSlotNo( tx ); | |
31 |
1
1. txToTxFilterResponse : negated conditional → NO_COVERAGE |
if ( slotNo != null ) { |
32 |
1
1. txToTxFilterResponse : removed call to org/cardanofoundation/explorer/api/model/response/TxFilterResponse::setSlot → NO_COVERAGE |
txFilterResponse.setSlot( slotNo.intValue() ); |
33 | } | |
34 |
1
1. txToTxFilterResponse : removed call to org/cardanofoundation/explorer/api/model/response/TxFilterResponse::setBlockNo → NO_COVERAGE |
txFilterResponse.setBlockNo( txBlockBlockNo( tx ) ); |
35 |
1
1. txToTxFilterResponse : removed call to org/cardanofoundation/explorer/api/model/response/TxFilterResponse::setBlockHash → NO_COVERAGE |
txFilterResponse.setBlockHash( txBlockHash( tx ) ); |
36 |
1
1. txToTxFilterResponse : removed call to org/cardanofoundation/explorer/api/model/response/TxFilterResponse::setTime → NO_COVERAGE |
txFilterResponse.setTime( fromTimestamp( txBlockTime( tx ) ) ); |
37 |
1
1. txToTxFilterResponse : removed call to org/cardanofoundation/explorer/api/model/response/TxFilterResponse::setId → NO_COVERAGE |
txFilterResponse.setId( tx.getId() ); |
38 |
1
1. txToTxFilterResponse : removed call to org/cardanofoundation/explorer/api/model/response/TxFilterResponse::setHash → NO_COVERAGE |
txFilterResponse.setHash( tx.getHash() ); |
39 |
1
1. txToTxFilterResponse : removed call to org/cardanofoundation/explorer/api/model/response/TxFilterResponse::setFee → NO_COVERAGE |
txFilterResponse.setFee( tx.getFee() ); |
40 | ||
41 |
1
1. txToTxFilterResponse : replaced return value with null for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txToTxFilterResponse → NO_COVERAGE |
return txFilterResponse; |
42 | } | |
43 | ||
44 | @Override | |
45 | public TxResponse txToTxResponse(Tx tx) { | |
46 |
1
1. txToTxResponse : negated conditional → NO_COVERAGE |
if ( tx == null ) { |
47 | return null; | |
48 | } | |
49 | ||
50 | TxResponse txResponse = new TxResponse(); | |
51 | ||
52 |
1
1. txToTxResponse : negated conditional → NO_COVERAGE |
if ( tx.getBlock() != null ) { |
53 |
1
1. txToTxResponse : negated conditional → NO_COVERAGE |
if ( txResponse.getTx() == null ) { |
54 |
1
1. txToTxResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxResponse::setTx → NO_COVERAGE |
txResponse.setTx( TxInfoResponse.builder().build() ); |
55 | } | |
56 |
1
1. txToTxResponse : removed call to org/cardanofoundation/explorer/api/mapper/TxMapperImpl::blockToTxInfoResponse → NO_COVERAGE |
blockToTxInfoResponse( tx.getBlock(), txResponse.getTx() ); |
57 | } | |
58 |
1
1. txToTxResponse : negated conditional → NO_COVERAGE |
if ( txResponse.getTx() == null ) { |
59 |
1
1. txToTxResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxResponse::setTx → NO_COVERAGE |
txResponse.setTx( TxInfoResponse.builder().build() ); |
60 | } | |
61 |
1
1. txToTxResponse : removed call to org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txToTxInfoResponse → NO_COVERAGE |
txToTxInfoResponse( tx, txResponse.getTx() ); |
62 | ||
63 |
1
1. txToTxResponse : replaced return value with null for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txToTxResponse → NO_COVERAGE |
return txResponse; |
64 | } | |
65 | ||
66 | private Integer txBlockEpochNo(Tx tx) { | |
67 |
1
1. txBlockEpochNo : negated conditional → NO_COVERAGE |
if ( tx == null ) { |
68 |
1
1. txBlockEpochNo : replaced Integer return value with 0 for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockEpochNo → NO_COVERAGE |
return null; |
69 | } | |
70 | Block block = tx.getBlock(); | |
71 |
1
1. txBlockEpochNo : negated conditional → NO_COVERAGE |
if ( block == null ) { |
72 |
1
1. txBlockEpochNo : replaced Integer return value with 0 for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockEpochNo → NO_COVERAGE |
return null; |
73 | } | |
74 | Integer epochNo = block.getEpochNo(); | |
75 |
1
1. txBlockEpochNo : negated conditional → NO_COVERAGE |
if ( epochNo == null ) { |
76 |
1
1. txBlockEpochNo : replaced Integer return value with 0 for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockEpochNo → NO_COVERAGE |
return null; |
77 | } | |
78 |
1
1. txBlockEpochNo : replaced Integer return value with 0 for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockEpochNo → NO_COVERAGE |
return epochNo; |
79 | } | |
80 | ||
81 | private Integer txBlockEpochSlotNo(Tx tx) { | |
82 |
1
1. txBlockEpochSlotNo : negated conditional → NO_COVERAGE |
if ( tx == null ) { |
83 |
1
1. txBlockEpochSlotNo : replaced Integer return value with 0 for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockEpochSlotNo → NO_COVERAGE |
return null; |
84 | } | |
85 | Block block = tx.getBlock(); | |
86 |
1
1. txBlockEpochSlotNo : negated conditional → NO_COVERAGE |
if ( block == null ) { |
87 |
1
1. txBlockEpochSlotNo : replaced Integer return value with 0 for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockEpochSlotNo → NO_COVERAGE |
return null; |
88 | } | |
89 | Integer epochSlotNo = block.getEpochSlotNo(); | |
90 |
1
1. txBlockEpochSlotNo : negated conditional → NO_COVERAGE |
if ( epochSlotNo == null ) { |
91 |
1
1. txBlockEpochSlotNo : replaced Integer return value with 0 for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockEpochSlotNo → NO_COVERAGE |
return null; |
92 | } | |
93 |
1
1. txBlockEpochSlotNo : replaced Integer return value with 0 for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockEpochSlotNo → NO_COVERAGE |
return epochSlotNo; |
94 | } | |
95 | ||
96 | private Long txBlockSlotNo(Tx tx) { | |
97 |
1
1. txBlockSlotNo : negated conditional → NO_COVERAGE |
if ( tx == null ) { |
98 |
1
1. txBlockSlotNo : replaced Long return value with 0L for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockSlotNo → NO_COVERAGE |
return null; |
99 | } | |
100 | Block block = tx.getBlock(); | |
101 |
1
1. txBlockSlotNo : negated conditional → NO_COVERAGE |
if ( block == null ) { |
102 |
1
1. txBlockSlotNo : replaced Long return value with 0L for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockSlotNo → NO_COVERAGE |
return null; |
103 | } | |
104 | Long slotNo = block.getSlotNo(); | |
105 |
1
1. txBlockSlotNo : negated conditional → NO_COVERAGE |
if ( slotNo == null ) { |
106 |
1
1. txBlockSlotNo : replaced Long return value with 0L for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockSlotNo → NO_COVERAGE |
return null; |
107 | } | |
108 |
1
1. txBlockSlotNo : replaced Long return value with 0L for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockSlotNo → NO_COVERAGE |
return slotNo; |
109 | } | |
110 | ||
111 | private Long txBlockBlockNo(Tx tx) { | |
112 |
1
1. txBlockBlockNo : negated conditional → NO_COVERAGE |
if ( tx == null ) { |
113 |
1
1. txBlockBlockNo : replaced Long return value with 0L for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockBlockNo → NO_COVERAGE |
return null; |
114 | } | |
115 | Block block = tx.getBlock(); | |
116 |
1
1. txBlockBlockNo : negated conditional → NO_COVERAGE |
if ( block == null ) { |
117 |
1
1. txBlockBlockNo : replaced Long return value with 0L for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockBlockNo → NO_COVERAGE |
return null; |
118 | } | |
119 | Long blockNo = block.getBlockNo(); | |
120 |
1
1. txBlockBlockNo : negated conditional → NO_COVERAGE |
if ( blockNo == null ) { |
121 |
1
1. txBlockBlockNo : replaced Long return value with 0L for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockBlockNo → NO_COVERAGE |
return null; |
122 | } | |
123 |
1
1. txBlockBlockNo : replaced Long return value with 0L for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockBlockNo → NO_COVERAGE |
return blockNo; |
124 | } | |
125 | ||
126 | private String txBlockHash(Tx tx) { | |
127 |
1
1. txBlockHash : negated conditional → NO_COVERAGE |
if ( tx == null ) { |
128 |
1
1. txBlockHash : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockHash → NO_COVERAGE |
return null; |
129 | } | |
130 | Block block = tx.getBlock(); | |
131 |
1
1. txBlockHash : negated conditional → NO_COVERAGE |
if ( block == null ) { |
132 |
1
1. txBlockHash : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockHash → NO_COVERAGE |
return null; |
133 | } | |
134 | String hash = block.getHash(); | |
135 |
1
1. txBlockHash : negated conditional → NO_COVERAGE |
if ( hash == null ) { |
136 |
1
1. txBlockHash : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockHash → NO_COVERAGE |
return null; |
137 | } | |
138 |
1
1. txBlockHash : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockHash → NO_COVERAGE |
return hash; |
139 | } | |
140 | ||
141 | private Timestamp txBlockTime(Tx tx) { | |
142 |
1
1. txBlockTime : negated conditional → NO_COVERAGE |
if ( tx == null ) { |
143 | return null; | |
144 | } | |
145 | Block block = tx.getBlock(); | |
146 |
1
1. txBlockTime : negated conditional → NO_COVERAGE |
if ( block == null ) { |
147 | return null; | |
148 | } | |
149 | Timestamp time = block.getTime(); | |
150 |
1
1. txBlockTime : negated conditional → NO_COVERAGE |
if ( time == null ) { |
151 | return null; | |
152 | } | |
153 |
1
1. txBlockTime : replaced return value with null for org/cardanofoundation/explorer/api/mapper/TxMapperImpl::txBlockTime → NO_COVERAGE |
return time; |
154 | } | |
155 | ||
156 | protected void blockToTxInfoResponse(Block block, TxInfoResponse mappingTarget) { | |
157 |
1
1. blockToTxInfoResponse : negated conditional → NO_COVERAGE |
if ( block == null ) { |
158 | return; | |
159 | } | |
160 | ||
161 |
1
1. blockToTxInfoResponse : negated conditional → NO_COVERAGE |
if ( block.getBlockNo() != null ) { |
162 |
1
1. blockToTxInfoResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxInfoResponse::setBlockNo → NO_COVERAGE |
mappingTarget.setBlockNo( block.getBlockNo().intValue() ); |
163 | } | |
164 | else { | |
165 |
1
1. blockToTxInfoResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxInfoResponse::setBlockNo → NO_COVERAGE |
mappingTarget.setBlockNo( null ); |
166 | } | |
167 |
1
1. blockToTxInfoResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxInfoResponse::setBlockHash → NO_COVERAGE |
mappingTarget.setBlockHash( block.getHash() ); |
168 |
1
1. blockToTxInfoResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxInfoResponse::setEpochSlot → NO_COVERAGE |
mappingTarget.setEpochSlot( block.getEpochSlotNo() ); |
169 |
1
1. blockToTxInfoResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxInfoResponse::setEpochNo → NO_COVERAGE |
mappingTarget.setEpochNo( block.getEpochNo() ); |
170 |
1
1. blockToTxInfoResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxInfoResponse::setTime → NO_COVERAGE |
mappingTarget.setTime( fromTimestamp( block.getTime() ) ); |
171 |
1
1. blockToTxInfoResponse : negated conditional → NO_COVERAGE |
if ( block.getSlotNo() != null ) { |
172 |
1
1. blockToTxInfoResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxInfoResponse::setSlotNo → NO_COVERAGE |
mappingTarget.setSlotNo( block.getSlotNo().intValue() ); |
173 | } | |
174 | else { | |
175 |
1
1. blockToTxInfoResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxInfoResponse::setSlotNo → NO_COVERAGE |
mappingTarget.setSlotNo( null ); |
176 | } | |
177 |
1
1. blockToTxInfoResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxInfoResponse::setHash → NO_COVERAGE |
mappingTarget.setHash( block.getHash() ); |
178 | } | |
179 | ||
180 | protected void txToTxInfoResponse(Tx tx, TxInfoResponse mappingTarget) { | |
181 |
1
1. txToTxInfoResponse : negated conditional → NO_COVERAGE |
if ( tx == null ) { |
182 | return; | |
183 | } | |
184 | ||
185 |
1
1. txToTxInfoResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxInfoResponse::setHash → NO_COVERAGE |
mappingTarget.setHash( tx.getHash() ); |
186 |
1
1. txToTxInfoResponse : removed call to org/cardanofoundation/explorer/api/model/response/tx/TxInfoResponse::setFee → NO_COVERAGE |
mappingTarget.setFee( tx.getFee() ); |
187 | } | |
188 | } | |
Mutations | ||
22 |
1.1 |
|
28 |
1.1 |
|
29 |
1.1 |
|
31 |
1.1 |
|
32 |
1.1 |
|
34 |
1.1 |
|
35 |
1.1 |
|
36 |
1.1 |
|
37 |
1.1 |
|
38 |
1.1 |
|
39 |
1.1 |
|
41 |
1.1 |
|
46 |
1.1 |
|
52 |
1.1 |
|
53 |
1.1 |
|
54 |
1.1 |
|
56 |
1.1 |
|
58 |
1.1 |
|
59 |
1.1 |
|
61 |
1.1 |
|
63 |
1.1 |
|
67 |
1.1 |
|
68 |
1.1 |
|
71 |
1.1 |
|
72 |
1.1 |
|
75 |
1.1 |
|
76 |
1.1 |
|
78 |
1.1 |
|
82 |
1.1 |
|
83 |
1.1 |
|
86 |
1.1 |
|
87 |
1.1 |
|
90 |
1.1 |
|
91 |
1.1 |
|
93 |
1.1 |
|
97 |
1.1 |
|
98 |
1.1 |
|
101 |
1.1 |
|
102 |
1.1 |
|
105 |
1.1 |
|
106 |
1.1 |
|
108 |
1.1 |
|
112 |
1.1 |
|
113 |
1.1 |
|
116 |
1.1 |
|
117 |
1.1 |
|
120 |
1.1 |
|
121 |
1.1 |
|
123 |
1.1 |
|
127 |
1.1 |
|
128 |
1.1 |
|
131 |
1.1 |
|
132 |
1.1 |
|
135 |
1.1 |
|
136 |
1.1 |
|
138 |
1.1 |
|
142 |
1.1 |
|
146 |
1.1 |
|
150 |
1.1 |
|
153 |
1.1 |
|
157 |
1.1 |
|
161 |
1.1 |
|
162 |
1.1 |
|
165 |
1.1 |
|
167 |
1.1 |
|
168 |
1.1 |
|
169 |
1.1 |
|
170 |
1.1 |
|
171 |
1.1 |
|
172 |
1.1 |
|
175 |
1.1 |
|
177 |
1.1 |
|
181 |
1.1 |
|
185 |
1.1 |
|
186 |
1.1 |