Package: ChangeSetFactory
ChangeSetFactory
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ChangeSetFactory() |
|
|
|
|
|
||||||||||||||||||||
createObjectChangeSet(Object, Object, Descriptor) |
|
|
|
|
|
||||||||||||||||||||
createUoWChangeSet() |
|
|
|
|
|
||||||||||||||||||||
static {...} |
|
|
|
|
|
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: }