Skip to content

Package: DiffDefinition

DiffDefinition

nameinstructionbranchcomplexitylinemethod
DiffDefinition(Boolean, Boolean, DiffIdentifier, String)
M: 0 C: 15
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 6
100%
M: 0 C: 1
100%
DiffDefinition(Boolean, Boolean, DiffIdentifier, String, String)
M: 0 C: 18
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
equals(Object)
M: 28 C: 73
72%
M: 16 C: 20
56%
M: 12 C: 7
37%
M: 12 C: 21
64%
M: 0 C: 1
100%
getComment()
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%
getContent()
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%
getIdentifier()
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%
getOpt()
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%
getRealyOpt()
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%
hasSameContent(DiffFileEntity)
M: 0 C: 26
100%
M: 3 C: 5
63%
M: 3 C: 2
40%
M: 0 C: 7
100%
M: 0 C: 1
100%
hashCode()
M: 8 C: 63
89%
M: 4 C: 6
60%
M: 4 C: 2
33%
M: 0 C: 13
100%
M: 0 C: 1
100%
toString()
M: 32 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package migration.difffile.objects;
2:
3: /**
4: * Klassifierung von Variablendefinitionen.
5: *
6: * @author Jan Schering
7: *
8: */
9: public class DiffDefinition implements DiffFileEntity {
10:
11:         private final Boolean opt;
12:
13:         private final Boolean realyOpt;
14:
15:         private final DiffIdentifier id;
16:
17:         private final String content;
18:
19:         private String comment;
20:
21:         public DiffDefinition(Boolean opt, Boolean realyOpt, DiffIdentifier id, String content) {
22:                 this.id = id;
23:                 this.content = content;
24:                 this.opt = opt;
25:                 this.realyOpt = realyOpt;
26:         }
27:
28:         public DiffDefinition(Boolean opt, Boolean realyOpt, DiffIdentifier id, String content,
29:                         String comment) {
30:                 this.id = id;
31:                 this.content = content;
32:                 this.opt = opt;
33:                 this.realyOpt = realyOpt;
34:                 this.comment = comment;
35:         }
36:
37:         public Boolean getOpt() {
38:                 return opt;
39:         }
40:
41:         public Boolean getRealyOpt() {
42:                 return realyOpt;
43:         }
44:
45:         public DiffIdentifier getIdentifier() {
46:                 return id;
47:         }
48:
49:         public String getContent() {
50:                 return content;
51:         }
52:
53:         public String getComment() {
54:                 return comment;
55:         }
56:
57:         @Override
58:         public String toString() {
59:                 return "DiffDefinition [opt=" + opt + ", realyOpt=" + realyOpt + ", id=" + id
60:                                 + ", content=" + content + ", comment=" + comment + "]";
61:         }
62:
63:         @Override
64:         public int hashCode() {
65:                 final int prime = 31;
66:                 int result = 1;
67:•                result = prime * result + ((comment == null)
68:                                 ? 0
69:                                 : comment.hashCode());
70:•                result = prime * result + ((content == null)
71:                                 ? 0
72:                                 : content.hashCode());
73:•                result = prime * result + ((id == null)
74:                                 ? 0
75:                                 : id.hashCode());
76:•                result = prime * result + ((opt == null)
77:                                 ? 0
78:                                 : opt.hashCode());
79:•                result = prime * result + ((realyOpt == null)
80:                                 ? 0
81:                                 : realyOpt.hashCode());
82:                 return result;
83:         }
84:
85:         @Override
86:         public boolean equals(final Object obj) {
87:•                if (this == obj) {
88:                         return true;
89:                 }
90:•                if (obj == null) {
91:                         return false;
92:                 }
93:•                if (getClass() != obj.getClass()) {
94:                         return false;
95:                 }
96:                 final DiffDefinition other = (DiffDefinition) obj;
97:•                if (comment == null) {
98:•                        if (other.comment != null) {
99:                                 return false;
100:                         }
101:•                } else if (!comment.equals(other.comment)) {
102:                         return false;
103:                 }
104:•                if (content == null) {
105:•                        if (other.content != null) {
106:                                 return false;
107:                         }
108:•                } else if (!content.equals(other.content)) {
109:                         return false;
110:                 }
111:•                if (id == null) {
112:•                        if (other.id != null) {
113:                                 return false;
114:                         }
115:•                } else if (!id.equals(other.id)) {
116:                         return false;
117:                 }
118:•                if (opt == null) {
119:•                        if (other.opt != null) {
120:                                 return false;
121:                         }
122:•                } else if (!opt.equals(other.opt)) {
123:                         return false;
124:                 }
125:•                if (realyOpt == null) {
126:•                        if (other.realyOpt != null) {
127:                                 return false;
128:                         }
129:•                } else if (!realyOpt.equals(other.realyOpt)) {
130:                         return false;
131:                 }
132:                 return true;
133:         }
134:
135:         /**
136:          * @param line
137:          * the other line to compare
138:          * @return true if and only if the opt, really opt and content of this line equals with the
139:          * other line
140:          */
141:         @Override
142:         public boolean hasSameContent(final DiffFileEntity line) {
143:•                if (line instanceof DiffDefinition) {
144:                         final DiffDefinition otherDiffDefinition = (DiffDefinition) line;
145:•                        if (this.getOpt() == otherDiffDefinition.getOpt()) {
146:•                                if (this.getRealyOpt() == otherDiffDefinition.getRealyOpt()) {
147:•                                        if (this.getContent().equals(otherDiffDefinition.getContent())) {
148:                                                 return true;
149:                                         }
150:                                 }
151:                         }
152:                 }
153:                 return false;
154:         }
155: }