Skip to contentPackage: ObjectChangeSet
ObjectChangeSet
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;
16:
17: import java.net.URI;
18: import java.util.Map;
19:
20: public interface ObjectChangeSet {
21:
22: /**
23: * Adds a new change record to this change set.
24: * <p/>
25: * If there was a change for attribute represented by the new record, it will be overwritten.
26: *
27: * @param record The record to add
28: */
29: public void addChangeRecord(ChangeRecord record);
30:
31: /**
32: * Gets type of the changed object.
33: *
34: * @return Object type
35: */
36: public Class<?> getObjectClass();
37:
38: /**
39: * Gets changes mapped by attribute names.
40: *
41: * @return Map of changes keyed by attribute names
42: */
43: public Map<String, ChangeRecord> getChanges();
44:
45: /**
46: * Specifies whether this change set represents a new object.
47: *
48: * @param isNew Whether this is a new object's change set
49: */
50: public void setNew(boolean isNew);
51:
52: /**
53: * Whether this is a new object's change set
54: */
55: public boolean isNew();
56:
57: /**
58: * Gets the clone with changes.
59: *
60: * @return Clone
61: */
62: public Object getCloneObject();
63:
64: /**
65: * Gets the original object.
66: *
67: * @return Original
68: */
69: public Object getChangedObject();
70:
71: /**
72: * Gets ontology context URI, to which the changed object belongs.
73: *
74: * @return context URI
75: */
76: public URI getEntityContext();
77: }