• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jreleaser / jreleaser / #477

04 Apr 2025 05:53PM UTC coverage: 35.124% (-5.1%) from 40.183%
#477

push

github

aalmiray
fix(deploy): Add missing Forgejo messages

Related to #1842

18210 of 51845 relevant lines covered (35.12%)

0.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.78
/core/jreleaser-model-impl/src/main/java/org/jreleaser/model/internal/catalog/AbstractCataloger.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 *
4
 * Copyright 2020-2025 The JReleaser authors.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     https://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
package org.jreleaser.model.internal.catalog;
19

20
import com.fasterxml.jackson.annotation.JsonIgnore;
21
import org.jreleaser.model.internal.common.AbstractActivatable;
22
import org.jreleaser.model.internal.common.ExtraProperties;
23

24
import java.util.Collections;
25
import java.util.LinkedHashMap;
26
import java.util.Map;
27

28
/**
29
 * @author Andres Almiray
30
 * @since 1.6.0
31
 */
32
public abstract class AbstractCataloger<S extends AbstractCataloger<S, A>, A extends org.jreleaser.model.api.catalog.Cataloger> extends AbstractActivatable<S> implements Cataloger<A>, ExtraProperties {
33
    private static final long serialVersionUID = -6677881013912645741L;
34

35
    @JsonIgnore
36
    private final String type;
37
    private final Map<String, Object> extraProperties = new LinkedHashMap<>();
1✔
38

39
    protected AbstractCataloger(String type) {
1✔
40
        this.type = type;
1✔
41
    }
1✔
42

43
    @Override
44
    public void merge(S source) {
45
        super.merge(source);
1✔
46
        setExtraProperties(merge(this.extraProperties, source.getExtraProperties()));
1✔
47
    }
1✔
48

49
    @Override
50
    protected boolean isSet() {
51
        return super.isSet() ||
×
52
            !extraProperties.isEmpty();
×
53
    }
54

55
    @Override
56
    public String prefix() {
57
        return getType();
×
58
    }
59

60
    @Override
61
    public boolean isSnapshotSupported() {
62
        return false;
×
63
    }
64

65
    @Override
66
    public String getType() {
67
        return type;
1✔
68
    }
69

70
    @Override
71
    public Map<String, Object> getExtraProperties() {
72
        return extraProperties;
1✔
73
    }
74

75
    @Override
76
    public void setExtraProperties(Map<String, Object> extraProperties) {
77
        this.extraProperties.clear();
1✔
78
        this.extraProperties.putAll(extraProperties);
1✔
79
    }
1✔
80

81
    @Override
82
    public void addExtraProperties(Map<String, Object> extraProperties) {
83
        this.extraProperties.putAll(extraProperties);
×
84
    }
×
85

86
    @Override
87
    public Map<String, Object> asMap(boolean full) {
88
        if (!full && !isEnabled()) return Collections.emptyMap();
1✔
89

90
        Map<String, Object> props = new LinkedHashMap<>();
1✔
91
        props.put("enabled", isEnabled());
1✔
92
        props.put("active", getActive());
1✔
93
        asMap(full, props);
1✔
94
        props.put("extraProperties", getExtraProperties());
1✔
95

96
        Map<String, Object> map = new LinkedHashMap<>();
1✔
97
        map.put(this.getType(), props);
1✔
98
        return map;
1✔
99
    }
100

101
    protected abstract void asMap(boolean full, Map<String, Object> props);
102
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc