This project has retired. For details please refer to its
Attic page.
ObjectDataImpl xref
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.chemistry.opencmis.commons.impl.dataobjects;
20
21 import java.util.List;
22
23 import org.apache.chemistry.opencmis.commons.PropertyIds;
24 import org.apache.chemistry.opencmis.commons.data.Acl;
25 import org.apache.chemistry.opencmis.commons.data.AllowableActions;
26 import org.apache.chemistry.opencmis.commons.data.ChangeEventInfo;
27 import org.apache.chemistry.opencmis.commons.data.ObjectData;
28 import org.apache.chemistry.opencmis.commons.data.PolicyIdList;
29 import org.apache.chemistry.opencmis.commons.data.Properties;
30 import org.apache.chemistry.opencmis.commons.data.PropertyData;
31 import org.apache.chemistry.opencmis.commons.data.RenditionData;
32 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
33
34
35
36
37 public class ObjectDataImpl extends AbstractExtensionData implements ObjectData {
38
39 private static final long serialVersionUID = 1L;
40
41 private Properties properties;
42 private ChangeEventInfo changeEventInfo;
43 private List<ObjectData> relationships;
44 private List<RenditionData> renditions;
45 private PolicyIdList policyIds;
46 private AllowableActions allowableActions;
47 private Acl acl;
48 private Boolean isExactAcl;
49
50 public String getId() {
51 Object value = getFirstValue(PropertyIds.OBJECT_ID);
52 if (value instanceof String) {
53 return (String) value;
54 }
55
56 return null;
57 }
58
59 public BaseTypeId getBaseTypeId() {
60 Object value = getFirstValue(PropertyIds.BASE_TYPE_ID);
61 if (value instanceof String) {
62 try {
63 return BaseTypeId.fromValue((String) value);
64 } catch (Exception e) {
65 }
66 }
67
68 return null;
69 }
70
71 public Properties getProperties() {
72 return properties;
73 }
74
75 public void setProperties(Properties properties) {
76 this.properties = properties;
77 }
78
79 public ChangeEventInfo getChangeEventInfo() {
80 return changeEventInfo;
81 }
82
83 public void setChangeEventInfo(ChangeEventInfo changeEventInfo) {
84 this.changeEventInfo = changeEventInfo;
85 }
86
87 public List<ObjectData> getRelationships() {
88 return relationships;
89 }
90
91 public void setRelationships(List<ObjectData> relationships) {
92 this.relationships = relationships;
93 }
94
95 public List<RenditionData> getRenditions() {
96 return renditions;
97 }
98
99 public void setRenditions(List<RenditionData> renditions) {
100 this.renditions = renditions;
101 }
102
103 public PolicyIdList getPolicyIds() {
104 return policyIds;
105 }
106
107 public void setPolicyIds(PolicyIdList policyIds) {
108 this.policyIds = policyIds;
109 }
110
111 public AllowableActions getAllowableActions() {
112 return allowableActions;
113 }
114
115 public void setAllowableActions(AllowableActions allowableActions) {
116 this.allowableActions = allowableActions;
117 }
118
119 public Acl getAcl() {
120 return acl;
121 }
122
123 public void setAcl(Acl acl) {
124 this.acl = acl;
125 }
126
127 public Boolean isExactAcl() {
128 return isExactAcl;
129 }
130
131 public void setIsExactAcl(Boolean isExactACL) {
132 this.isExactAcl = isExactACL;
133 }
134
135
136
137
138
139
140
141 private Object getFirstValue(String id) {
142 if ((properties == null) || (properties.getProperties() == null)) {
143 return null;
144 }
145
146 PropertyData<?> property = properties.getProperties().get(id);
147 if (property == null) {
148 return null;
149 }
150
151 return property.getFirstValue();
152 }
153
154 @Override
155 public String toString() {
156 return "Object Data [properties=" + properties + ", allowable actions=" + allowableActions
157 + ", change event info=" + changeEventInfo + ", ACL=" + acl + ", is exact ACL=" + isExactAcl
158 + ", policy ids=" + policyIds + ", relationships=" + relationships + ", renditions=" + renditions
159 + "]" + super.toString();
160 }
161 }