Skip to content

Package: Module

Module

nameinstructionbranchcomplexitylinemethod
Module(String, String)
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
equals(Object)
M: 11 C: 35
76%
M: 7 C: 9
56%
M: 5 C: 4
44%
M: 3 C: 9
75%
M: 0 C: 1
100%
getName()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getPath()
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%
hashCode()
M: 4 C: 28
88%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 0 C: 7
100%
M: 0 C: 1
100%
toString()
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package kernelmodules;
2:
3: /**
4: * @author Markus. class of Module. attribute which represents the name of the module.
5: */
6:
7: public class Module {
8:
9:         /**
10:          * represents the name of the module.
11:          */
12:         private final String name;
13:
14:         /**
15:          * attribute which represents the path of the module.
16:          */
17:         private final String path;
18:
19:         /**
20:          * Constructor - No Side Effects.
21:          *
22:          * @param name
23:          * the name of the Module
24:          * @param path
25:          * the path to the module
26:          */
27:         protected Module(final String name, final String path) {
28:                 this.name = name;
29:                 this.path = path;
30:         }
31:
32:         /**
33:          * @return the name
34:          */
35:         public String getName() {
36:                 return this.name;
37:         }
38:
39:         /**
40:          * @return the path
41:          */
42:         public final String getPath() {
43:                 return this.path;
44:         }
45:
46:         /*
47:          * (non-Javadoc)
48:          *
49:          * @see java.lang.Object#hashCode()
50:          */
51:         @Override
52:         public int hashCode() {
53:                 final int prime = 31;
54:                 int result = 1;
55:•                result = prime * result + ((this.name == null)
56:                                 ? 0
57:                                 : this.name.hashCode());
58:•                result = prime * result + ((this.path == null)
59:                                 ? 0
60:                                 : this.path.hashCode());
61:                 return result;
62:         }
63:
64:         /*
65:          * (non-Javadoc)
66:          *
67:          * @see java.lang.Object#equals(java.lang.Object)
68:          */
69:         @Override
70:         public boolean equals(final Object obj) {
71:                 boolean erg = true;
72:
73:•                if (this == obj) {
74:                         erg = true;
75:                 }
76:•                if (!(obj instanceof Module)) {
77:                         erg = false;
78:                 }
79:                 final Module other = (Module) obj;
80:•                if (this.name == null || this.path == null) {
81:•                        if (other.name != null || this.path != null) {
82:                                 erg = false;
83:                         }
84:•                } else if (!this.name.equals(other.name) || !this.path.equals(other.path)) {
85:                         erg = false;
86:                 }
87:                 return erg;
88:         }
89:
90:         /*
91:          * (non-Javadoc)
92:          *
93:          * @see java.lang.Object#toString()
94:          */
95:         @Override
96:         public String toString() {
97:                 final StringBuilder builder = new StringBuilder();
98:                 builder.append(this.path);
99:                 builder.append(this.name);
100:                 return builder.toString();
101:         }
102: }