Skip to content

Package: AboutEntry

AboutEntry

nameinstructionbranchcomplexitylinemethod
AboutEntry()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getId()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getLicense()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getNotice()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getVersion()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
setId(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setLicense(AboutEntry.License)
M: 8 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setName(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setNotice(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setVersion(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017, 2022 Red Hat Inc and others.
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Red Hat Inc - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.commons.about;
14:
15: import java.net.MalformedURLException;
16: import java.net.URL;
17:
18: public class AboutEntry {
19:
20: public static class License {
21:
22: public static final License UNKNOWN = new License("Unknown", null, null);
23: public static final License APL2;
24: public static final License EPL;
25:
26: static {
27: URL urlApache = null;
28: URL urlEpl = null;
29: try {
30: urlApache = new URL("http://www.apache.org/licenses/");
31: urlEpl = new URL("https://www.eclipse.org/legal/epl-2.0/");
32: } catch (MalformedURLException e) {
33: }
34:
35: APL2 = new License("Apache License 2.0", null, urlApache);
36: EPL = new License("EPL", "Eclipse Public License", urlEpl);
37: }
38:
39: private final String name;
40: private final String text;
41: private final URL url;
42:
43: public License(final String name, final String text, final URL url) {
44: this.name = name;
45: this.text = text;
46: this.url = url;
47: }
48:
49: public String getName() {
50: return name;
51: }
52:
53: public String getText() {
54: return text;
55: }
56:
57: public URL getUrl() {
58: return url;
59: }
60: }
61:
62: private String id;
63:
64: private String name;
65: private String version;
66: private License license = License.UNKNOWN;
67: private String notice;
68:
69: public void setId(final String id) {
70: this.id = id;
71: }
72:
73: public String getId() {
74: return id;
75: }
76:
77: public void setName(final String name) {
78: this.name = name;
79: }
80:
81: public String getName() {
82: return name;
83: }
84:
85: public void setVersion(final String version) {
86: this.version = version;
87: }
88:
89: public String getVersion() {
90: return version;
91: }
92:
93: public void setLicense(final License license) {
94:• this.license = license != null ? license : License.UNKNOWN;
95: }
96:
97: public License getLicense() {
98: return license;
99: }
100:
101: public void setNotice(String notice) {
102: this.notice = notice;
103: }
104:
105: public String getNotice() {
106: return notice;
107: }
108: }