DelegationMapperImpl.java

1
package org.cardanofoundation.explorer.api.mapper;
2
3
import javax.annotation.processing.Generated;
4
import org.cardanofoundation.explorer.api.model.response.tx.TxDelegationResponse;
5
import org.cardanofoundation.explorer.common.entity.ledgersync.Delegation;
6
import org.cardanofoundation.explorer.common.entity.ledgersync.PoolHash;
7
import org.cardanofoundation.explorer.common.entity.ledgersync.StakeAddress;
8
import org.springframework.stereotype.Component;
9
10
@Generated(
11
    value = "org.mapstruct.ap.MappingProcessor",
12
    date = "2024-11-05T06:00:27+0000",
13
    comments = "version: 1.5.3.Final, compiler: javac, environment: Java 18.0.2.1 (Eclipse Adoptium)"
14
)
15
@Component
16
public class DelegationMapperImpl implements DelegationMapper {
17
18
    @Override
19
    public TxDelegationResponse fromDelegation(Delegation delegation) {
20 1 1. fromDelegation : negated conditional → NO_COVERAGE
        if ( delegation == null ) {
21
            return null;
22
        }
23
24
        TxDelegationResponse.TxDelegationResponseBuilder txDelegationResponse = TxDelegationResponse.builder();
25
26
        txDelegationResponse.address( delegationAddressView( delegation ) );
27
        txDelegationResponse.poolId( delegationPoolHashView( delegation ) );
28
29 1 1. fromDelegation : replaced return value with null for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::fromDelegation → NO_COVERAGE
        return txDelegationResponse.build();
30
    }
31
32
    private String delegationAddressView(Delegation delegation) {
33 1 1. delegationAddressView : negated conditional → NO_COVERAGE
        if ( delegation == null ) {
34 1 1. delegationAddressView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationAddressView → NO_COVERAGE
            return null;
35
        }
36
        StakeAddress address = delegation.getAddress();
37 1 1. delegationAddressView : negated conditional → NO_COVERAGE
        if ( address == null ) {
38 1 1. delegationAddressView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationAddressView → NO_COVERAGE
            return null;
39
        }
40
        String view = address.getView();
41 1 1. delegationAddressView : negated conditional → NO_COVERAGE
        if ( view == null ) {
42 1 1. delegationAddressView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationAddressView → NO_COVERAGE
            return null;
43
        }
44 1 1. delegationAddressView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationAddressView → NO_COVERAGE
        return view;
45
    }
46
47
    private String delegationPoolHashView(Delegation delegation) {
48 1 1. delegationPoolHashView : negated conditional → NO_COVERAGE
        if ( delegation == null ) {
49 1 1. delegationPoolHashView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationPoolHashView → NO_COVERAGE
            return null;
50
        }
51
        PoolHash poolHash = delegation.getPoolHash();
52 1 1. delegationPoolHashView : negated conditional → NO_COVERAGE
        if ( poolHash == null ) {
53 1 1. delegationPoolHashView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationPoolHashView → NO_COVERAGE
            return null;
54
        }
55
        String view = poolHash.getView();
56 1 1. delegationPoolHashView : negated conditional → NO_COVERAGE
        if ( view == null ) {
57 1 1. delegationPoolHashView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationPoolHashView → NO_COVERAGE
            return null;
58
        }
59 1 1. delegationPoolHashView : replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationPoolHashView → NO_COVERAGE
        return view;
60
    }
61
}

Mutations

20

1.1
Location : fromDelegation
Killed by : none
negated conditional → NO_COVERAGE

29

1.1
Location : fromDelegation
Killed by : none
replaced return value with null for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::fromDelegation → NO_COVERAGE

33

1.1
Location : delegationAddressView
Killed by : none
negated conditional → NO_COVERAGE

34

1.1
Location : delegationAddressView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationAddressView → NO_COVERAGE

37

1.1
Location : delegationAddressView
Killed by : none
negated conditional → NO_COVERAGE

38

1.1
Location : delegationAddressView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationAddressView → NO_COVERAGE

41

1.1
Location : delegationAddressView
Killed by : none
negated conditional → NO_COVERAGE

42

1.1
Location : delegationAddressView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationAddressView → NO_COVERAGE

44

1.1
Location : delegationAddressView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationAddressView → NO_COVERAGE

48

1.1
Location : delegationPoolHashView
Killed by : none
negated conditional → NO_COVERAGE

49

1.1
Location : delegationPoolHashView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationPoolHashView → NO_COVERAGE

52

1.1
Location : delegationPoolHashView
Killed by : none
negated conditional → NO_COVERAGE

53

1.1
Location : delegationPoolHashView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationPoolHashView → NO_COVERAGE

56

1.1
Location : delegationPoolHashView
Killed by : none
negated conditional → NO_COVERAGE

57

1.1
Location : delegationPoolHashView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationPoolHashView → NO_COVERAGE

59

1.1
Location : delegationPoolHashView
Killed by : none
replaced return value with "" for org/cardanofoundation/explorer/api/mapper/DelegationMapperImpl::delegationPoolHashView → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.14.2