JdbcConnection.java

1
package org.europa.together.domain;
2
3
import java.util.Map;
4
5
/**
6
 * Contains all information about a JDBC connection. Immutable and read only
7
 * access.
8
 */
9
public final class JdbcConnection {
10
11
    //CHECKSTYLE:OFF
12
    /**
13
     * Version of the JDBC Driver.
14
     */
15
    public final String JDBC_VERSION;
16
    /**
17
     * DBMS Type.
18
     */
19
    public final String DBMS_NAME;
20
    /**
21
     * DBMS version.
22
     */
23
    public final String DBMS_VERSION;
24
    /**
25
     * Class name of the database driver.
26
     */
27
    public final String DRIVER_NAME;
28
    /**
29
     * Version number of the databae driver.
30
     */
31
    public final String DRIVER_VERSION;
32
    /**
33
     * DBMS user for the connection.
34
     */
35
    public final String USER;
36
    /**
37
     * DBMS connection string.
38
     */
39
    public final String URL;
40
    /**
41
     * DBMS connection IP
42
     */
43
    public final String IP;
44
    /**
45
     * DBMS connection port.
46
     */
47
    public final String PORT;
48
    /**
49
     * database schema name.
50
     */
51
    public final String CATALOG;
52
    //CHECKSTYLE:ON
53
54
    /**
55
     * Constructor.
56
     */
57
    private JdbcConnection() {
58
        throw new UnsupportedOperationException();
59
    }
60
61
    /**
62
     * Constructor.
63
     *
64
     * @param properties as List
65
     */
66
    public JdbcConnection(final Map<String, String> properties) {
67
68
        JDBC_VERSION = properties.get("metaJdbcVersion");
69
        DBMS_NAME = properties.get("metaDbmsName");
70
        DBMS_VERSION = properties.get("metaDbmsVersion");
71
        DRIVER_NAME = properties.get("metaJdbcDriverName");
72
        DRIVER_VERSION = properties.get("metaJdbcDriverVersion");
73
        USER = properties.get("metaUser");
74
        URL = properties.get("metaUrl");
75
        IP = properties.get("metaIP");
76
        PORT = properties.get("metaPort");
77
        CATALOG = properties.get("metaCatalog");
78
    }
79
80
    @Override
81
    public String toString() {
82 1 1. toString : replaced return value with "" for org/europa/together/domain/JdbcConnection::toString → SURVIVED
        return "JdbcConnection{"
83
                + " JDBC_VERSION=" + JDBC_VERSION
84
                + " DBMS_NAME=" + DBMS_NAME
85
                + " DBMS_VERSION=" + DBMS_VERSION
86
                + " DRIVER_NAME=" + DRIVER_NAME
87
                + " DRIVER_VERSION=" + DRIVER_VERSION
88
                + " USER=" + USER
89
                + " URL=" + URL
90
                + " IP=" + IP
91
                + " PORT=" + PORT
92
                + " CATALOG=" + CATALOG
93
                + " }";
94
    }
95
}

Mutations

82

1.1
Location : toString
Killed by : none
replaced return value with "" for org/europa/together/domain/JdbcConnection::toString → SURVIVED
Covering tests

Active mutators

Tests examined


Report generated by PIT 1.22.0