BasicServerInfo.java

1
/*
2
 * Copyright 2019 Hector Espert.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package es.blackleg.jlibnotify.core;
17
18
import es.blackleg.jlibnotify.ServerInfo;
19
20
/**
21
 * Immutable {@link ServerInfo} holding the values read from the notification server.
22
 *
23
 * <p>Implementation detail of {@link DefaultJLibnotify#getServerInfo()}; application code should
24
 * depend on the {@link ServerInfo} interface instead.</p>
25
 *
26
 * @author Hector Espert
27
 */
28
public class BasicServerInfo implements ServerInfo {
29
30
    private final String name;
31
32
    private final String vendor;
33
34
    private final String version;
35
36
    private final String specVersion;
37
38
    /**
39
     * Creates a description of a notification server.
40
     *
41
     * @param name        product name of the server
42
     * @param vendor      vendor of the server
43
     * @param version     version of the server
44
     * @param specVersion version of the freedesktop.org notification specification it implements
45
     */
46
    public BasicServerInfo(String name, String vendor, String version, String specVersion) {
47
        this.name = name;
48
        this.vendor = vendor;
49
        this.version = version;
50
        this.specVersion = specVersion;
51
    }
52
53
    @Override
54
    public String getName() {
55 1 1. getName : replaced return value with "" for es/blackleg/jlibnotify/core/BasicServerInfo::getName → NO_COVERAGE
        return name;
56
    }
57
58
    @Override
59
    public String getVendor() {
60 1 1. getVendor : replaced return value with "" for es/blackleg/jlibnotify/core/BasicServerInfo::getVendor → NO_COVERAGE
        return vendor;
61
    }
62
63
    @Override
64
    public String getVersion() {
65 1 1. getVersion : replaced return value with "" for es/blackleg/jlibnotify/core/BasicServerInfo::getVersion → NO_COVERAGE
        return version;
66
    }
67
68
    @Override
69
    public String getSpecVersion() {
70 1 1. getSpecVersion : replaced return value with "" for es/blackleg/jlibnotify/core/BasicServerInfo::getSpecVersion → NO_COVERAGE
        return specVersion;
71
    }
72
73
    @Override
74
    public String toString() {
75 1 1. toString : replaced return value with "" for es/blackleg/jlibnotify/core/BasicServerInfo::toString → KILLED
        return "BasicServerInfo{" + "name=" + name + ", vendor=" + vendor + ", version=" + version + ", specVersion=" + specVersion + '}';
76
    }
77
78
}

Mutations

55

1.1
Location : getName
Killed by : none
replaced return value with "" for es/blackleg/jlibnotify/core/BasicServerInfo::getName → NO_COVERAGE

60

1.1
Location : getVendor
Killed by : none
replaced return value with "" for es/blackleg/jlibnotify/core/BasicServerInfo::getVendor → NO_COVERAGE

65

1.1
Location : getVersion
Killed by : none
replaced return value with "" for es/blackleg/jlibnotify/core/BasicServerInfo::getVersion → NO_COVERAGE

70

1.1
Location : getSpecVersion
Killed by : none
replaced return value with "" for es/blackleg/jlibnotify/core/BasicServerInfo::getSpecVersion → NO_COVERAGE

75

1.1
Location : toString
Killed by : es.blackleg.jlibnotify.core.BasicServerInfoTest.testToString(es.blackleg.jlibnotify.core.BasicServerInfoTest)
replaced return value with "" for es/blackleg/jlibnotify/core/BasicServerInfo::toString → KILLED

Active mutators

Tests examined


Report generated by PIT 1.30.0 support