Skip to content

Package: Option

Option

nameinstructionbranchcomplexitylinemethod
Option(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: 0 C: 21
100%
M: 1 C: 5
83%
M: 1 C: 3
75%
M: 0 C: 2
100%
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%
getValue()
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%
hashCode()
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toString()
M: 0 C: 14
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /**
2: *
3: */
4: package model.packages;
5:
6: import scanner.ScannerConstants;
7:
8: /**
9: * This class represents the options of the package rule.
10: *
11: * @author HFW410
12: *
13: */
14: public class Option {
15:         /**
16:          * represents the value of the option.
17:          */
18:         private final String value;
19:         /**
20:          * represents the name of the option.
21:          */
22:         private final String name;
23:
24:         /**
25:          * @param value
26:          * of the option
27:          * @param name
28:          * of the option
29:          */
30:         public Option(final String name, final String value) {
31:                 super();
32:                 this.value = value;
33:                 this.name = name;
34:         }
35:
36:         /**
37:          * @return the value
38:          */
39:         public String getValue() {
40:                 return this.value;
41:         }
42:
43:         /**
44:          * @return the name
45:          */
46:         public String getName() {
47:                 return this.name;
48:         }
49:
50:         @Override
51:         public String toString() {
52:                 return this.getName() + ScannerConstants.COLONSIGN.toString() + this.getValue();
53:         }
54:
55:         @Override
56:         public boolean equals(final Object obj) {
57:•                return obj instanceof Option && ((Option) obj).getName().equals(this.getName())
58:•                                && ((Option) obj).getValue().equals(this.getValue());
59:
60:         }
61:
62:         @Override
63:         public int hashCode() {
64:                 return this.getName().hashCode() + this.getValue().hashCode();
65:         }
66:
67: }