Skip to content

Package: ChangeRecordImpl

ChangeRecordImpl

nameinstructionbranchcomplexitylinemethod
ChangeRecordImpl(FieldSpecification, Object)
M: 4 C: 12
75%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 5
100%
M: 0 C: 1
100%
doesPreventCaching()
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%
getAttribute()
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%
getNewValue()
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%
preventCaching()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setNewValue(Object)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
static {...}
M: 0 C: 1
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toString()
M: 25 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) 2022 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.jopa.sessions.change;
16:
17: import cz.cvut.kbss.jopa.model.metamodel.FieldSpecification;
18: import cz.cvut.kbss.jopa.sessions.ChangeRecord;
19:
20: public class ChangeRecordImpl implements ChangeRecord {
21:
22: private final FieldSpecification<?, ?> attribute;
23:
24: private Object newValue;
25:
26: private boolean preventsCaching;
27:
28: public ChangeRecordImpl(FieldSpecification<?, ?> att, Object value) {
29:• assert att != null;
30: this.attribute = att;
31: this.newValue = value;
32: }
33:
34: @Override
35: public Object getNewValue() {
36: return newValue;
37: }
38:
39: @Override
40: public void setNewValue(Object value) {
41: this.newValue = value;
42: }
43:
44: @Override
45: public FieldSpecification<?, ?> getAttribute() {
46: return attribute;
47: }
48:
49: @Override
50: public void preventCaching() {
51: this.preventsCaching = true;
52: }
53:
54: @Override
55: public boolean doesPreventCaching() {
56: return preventsCaching;
57: }
58:
59: @Override
60: public String toString() {
61: return "ChangeRecordImpl{" +
62: "attribute='" + attribute.getName() + '\'' +
63: ", newValue=" + newValue +
64: ", preventsCaching=" + preventsCaching +
65: '}';
66: }
67: }