DRepMapperImpl.java

1
package org.cardanofoundation.explorer.api.mapper;
2
3
import javax.annotation.processing.Generated;
4
import org.cardanofoundation.explorer.api.model.response.drep.DRepDelegatorsResponse;
5
import org.cardanofoundation.explorer.api.model.response.drep.DRepDetailsResponse;
6
import org.cardanofoundation.explorer.api.model.response.drep.DRepFilterResponse;
7
import org.cardanofoundation.explorer.api.model.response.drep.DRepRangeValuesResponse;
8
import org.cardanofoundation.explorer.api.projection.DRepDelegatorProjection;
9
import org.cardanofoundation.explorer.api.projection.DRepRangeProjection;
10
import org.cardanofoundation.explorer.common.entity.ledgersync.DRepInfo;
11
import org.springframework.stereotype.Component;
12
13
@Generated(
14
    value = "org.mapstruct.ap.MappingProcessor",
15
    date = "2024-11-05T06:00:27+0000",
16
    comments = "version: 1.5.3.Final, compiler: javac, environment: Java 18.0.2.1 (Eclipse Adoptium)"
17
)
18
@Component
19
public class DRepMapperImpl implements DRepMapper {
20
21
    @Override
22
    public DRepDetailsResponse fromDrepInfo(DRepInfo dRepInfo) {
23 1 1. fromDrepInfo : negated conditional → KILLED
        if ( dRepInfo == null ) {
24
            return null;
25
        }
26
27
        DRepDetailsResponse.DRepDetailsResponseBuilder dRepDetailsResponse = DRepDetailsResponse.builder();
28
29 1 1. fromDrepInfo : negated conditional → KILLED
        if ( dRepInfo.getGovParticipationRate() != null ) {
30
            dRepDetailsResponse.votingParticipation( dRepInfo.getGovParticipationRate().floatValue() );
31
        }
32
        dRepDetailsResponse.drepHash( dRepInfo.getDrepHash() );
33
        dRepDetailsResponse.drepId( dRepInfo.getDrepId() );
34
        dRepDetailsResponse.anchorUrl( dRepInfo.getAnchorUrl() );
35
        dRepDetailsResponse.anchorHash( dRepInfo.getAnchorHash() );
36
        dRepDetailsResponse.delegators( dRepInfo.getDelegators() );
37
        dRepDetailsResponse.activeVoteStake( dRepInfo.getActiveVoteStake() );
38
        dRepDetailsResponse.liveStake( dRepInfo.getLiveStake() );
39
        dRepDetailsResponse.status( dRepInfo.getStatus() );
40
        dRepDetailsResponse.type( dRepInfo.getType() );
41
42
        dRepDetailsResponse.createdAt( fromLong(dRepInfo.getCreatedAt()) );
43
44 1 1. fromDrepInfo : replaced return value with null for org/cardanofoundation/explorer/api/mapper/DRepMapperImpl::fromDrepInfo → KILLED
        return dRepDetailsResponse.build();
45
    }
46
47
    @Override
48
    public DRepDelegatorsResponse fromDRepDelegatorProjection(DRepDelegatorProjection dRepDelegatorProjection) {
49 1 1. fromDRepDelegatorProjection : negated conditional → KILLED
        if ( dRepDelegatorProjection == null ) {
50
            return null;
51
        }
52
53
        DRepDelegatorsResponse.DRepDelegatorsResponseBuilder dRepDelegatorsResponse = DRepDelegatorsResponse.builder();
54
55
        dRepDelegatorsResponse.stakeAddress( dRepDelegatorProjection.getStakeAddress() );
56
        dRepDelegatorsResponse.fee( dRepDelegatorProjection.getFee() );
57
58
        dRepDelegatorsResponse.createdAt( fromLong(dRepDelegatorProjection.getBlockTime()) );
59
60 1 1. fromDRepDelegatorProjection : replaced return value with null for org/cardanofoundation/explorer/api/mapper/DRepMapperImpl::fromDRepDelegatorProjection → KILLED
        return dRepDelegatorsResponse.build();
61
    }
62
63
    @Override
64
    public DRepFilterResponse fromDRepInfo(DRepInfo dRepInfo) {
65 1 1. fromDRepInfo : negated conditional → KILLED
        if ( dRepInfo == null ) {
66
            return null;
67
        }
68
69
        DRepFilterResponse.DRepFilterResponseBuilder dRepFilterResponse = DRepFilterResponse.builder();
70
71
        dRepFilterResponse.drepId( dRepInfo.getDrepId() );
72
        dRepFilterResponse.drepHash( dRepInfo.getDrepHash() );
73
        dRepFilterResponse.anchorUrl( dRepInfo.getAnchorUrl() );
74
        dRepFilterResponse.anchorHash( dRepInfo.getAnchorHash() );
75
        dRepFilterResponse.activeVoteStake( dRepInfo.getActiveVoteStake() );
76
        dRepFilterResponse.votingPower( dRepInfo.getVotingPower() );
77
        dRepFilterResponse.status( dRepInfo.getStatus() );
78
        dRepFilterResponse.govParticipationRate( dRepInfo.getGovParticipationRate() );
79
80
        dRepFilterResponse.createdAt( fromLong(dRepInfo.getCreatedAt()) );
81
        dRepFilterResponse.updatedAt( fromLong(dRepInfo.getUpdatedAt()) );
82
83 1 1. fromDRepInfo : replaced return value with null for org/cardanofoundation/explorer/api/mapper/DRepMapperImpl::fromDRepInfo → KILLED
        return dRepFilterResponse.build();
84
    }
85
86
    @Override
87
    public DRepRangeValuesResponse fromDRepRangeProjection(DRepRangeProjection dRepRangeProjection) {
88 1 1. fromDRepRangeProjection : negated conditional → NO_COVERAGE
        if ( dRepRangeProjection == null ) {
89
            return null;
90
        }
91
92
        DRepRangeValuesResponse.DRepRangeValuesResponseBuilder<?, ?> dRepRangeValuesResponse = DRepRangeValuesResponse.builder();
93
94
        dRepRangeValuesResponse.minVotingPower( dRepRangeProjection.getMinVotingPower() );
95
        dRepRangeValuesResponse.maxVotingPower( dRepRangeProjection.getMaxVotingPower() );
96
        dRepRangeValuesResponse.maxActiveVoteStake( dRepRangeProjection.getMaxActiveVoteStake() );
97
        dRepRangeValuesResponse.minActiveVoteStake( dRepRangeProjection.getMinActiveVoteStake() );
98
        dRepRangeValuesResponse.minGovParticipationRate( dRepRangeProjection.getMinGovParticipationRate() );
99
        dRepRangeValuesResponse.maxGovParticipationRate( dRepRangeProjection.getMaxGovParticipationRate() );
100
101 1 1. fromDRepRangeProjection : replaced return value with null for org/cardanofoundation/explorer/api/mapper/DRepMapperImpl::fromDRepRangeProjection → NO_COVERAGE
        return dRepRangeValuesResponse.build();
102
    }
103
}

Mutations

23

1.1
Location : fromDrepInfo
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepDetail()]
negated conditional → KILLED

29

1.1
Location : fromDrepInfo
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepDetail()]
negated conditional → KILLED

44

1.1
Location : fromDrepInfo
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepDetail()]
replaced return value with null for org/cardanofoundation/explorer/api/mapper/DRepMapperImpl::fromDrepInfo → KILLED

49

1.1
Location : fromDRepDelegatorProjection
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testDRepGetDelegators()]
negated conditional → KILLED

60

1.1
Location : fromDRepDelegatorProjection
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testDRepGetDelegators()]
replaced return value with null for org/cardanofoundation/explorer/api/mapper/DRepMapperImpl::fromDRepDelegatorProjection → KILLED

65

1.1
Location : fromDRepInfo
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepListByFilter()]
negated conditional → KILLED

83

1.1
Location : fromDRepInfo
Killed by : org.cardanofoundation.explorer.api.service.DRepServiceTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.service.DRepServiceTest]/[method:testGetDRepListByFilter()]
replaced return value with null for org/cardanofoundation/explorer/api/mapper/DRepMapperImpl::fromDRepInfo → KILLED

88

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

101

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

Active mutators

Tests examined


Report generated by PIT 1.14.2