Skip to content

Package: ChangeSetFactory

ChangeSetFactory

nameinstructionbranchcomplexitylinemethod
ChangeSetFactory()
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%
createObjectChangeSet(Object, Object, Descriptor)
M: 8 C: 13
62%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 0 C: 3
100%
M: 0 C: 1
100%
createUoWChangeSet()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
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%

Coverage

1: /**
2: * Copyright (C) 2016 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.descriptors.Descriptor;
18: import cz.cvut.kbss.jopa.sessions.ObjectChangeSet;
19: import cz.cvut.kbss.jopa.sessions.UnitOfWorkChangeSet;
20:
21: public class ChangeSetFactory {
22:
23: private ChangeSetFactory() {
24: throw new AssertionError();
25: }
26:
27: /**
28: * Creates change set for the specified UnitOfWork.
29: *
30: * @return New change set
31: */
32: public static UnitOfWorkChangeSet createUoWChangeSet() {
33: return new UnitOfWorkChangeSetImpl();
34: }
35:
36: /**
37: * Creates new change set for the specified original-clone pair.
38: *
39: * @param original
40: * Original object
41: * @param clone
42: * Clone
43: * @param descriptor
44: * Entity descriptor
45: * @return New object change set
46: */
47: public static ObjectChangeSet createObjectChangeSet(Object original, Object clone, Descriptor descriptor) {
48:• assert original != null;
49:• assert descriptor != null;
50:
51: return new ObjectChangeSetImpl(original, clone, descriptor);
52: }
53: }