-
Notifications
You must be signed in to change notification settings - Fork 32
/
ODBFeatures.java
285 lines (216 loc) · 6.58 KB
/
ODBFeatures.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
package org.apache.tinkerpop.gremlin.orientdb;
import org.apache.tinkerpop.gremlin.structure.Graph.Features;
import org.apache.tinkerpop.gremlin.structure.Graph.Features.GraphFeatures;
import org.apache.tinkerpop.gremlin.structure.Graph.Features.VariableFeatures;
import org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexPropertyFeatures;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
public class ODBFeatures {
public static class OrientFeatures implements Features {
static final OrientFeatures INSTANCE_NOTX = new OrientFeatures(false);
static final OrientFeatures INSTANCE_TX = new OrientFeatures(true);
private OrientGraphFeatures graphFeatures;
private OrientFeatures(boolean transactionalGraph) {
this.graphFeatures = new OrientGraphFeatures(transactionalGraph);
}
@Override
public GraphFeatures graph() {
return graphFeatures;
}
@Override
public EdgeFeatures edge() {
return OrientEdgeFeatures.INSTANCE;
}
@Override
public VertexFeatures vertex() {
return OrientVertexFeatures.INSTANCE;
}
@Override
public String toString() {
return StringFactory.featureString(this);
}
}
public static abstract class OrientElementFeatures implements Features.ElementFeatures {
@Override
public boolean supportsAnyIds() {
return false;
}
@Override
public boolean supportsCustomIds() {
return false;
}
@Override
public boolean supportsNumericIds() {
return false;
}
@Override
public boolean supportsStringIds() {
return false;
}
@Override
public boolean supportsUserSuppliedIds() {
return false;
}
@Override
public boolean supportsUuidIds() {
return false;
}
@Override
public boolean willAllowId(Object id) {
return false;
}
}
public static class OrientVertexFeatures extends OrientElementFeatures implements Features.VertexFeatures {
static final OrientVertexFeatures INSTANCE = new OrientVertexFeatures();
private OrientVertexFeatures() {
}
@Override
public boolean supportsMultiProperties() {
return false;
}
@Override
public boolean supportsMetaProperties() {
return false;
}
@Override
public VertexPropertyFeatures properties() {
return OrientVertexPropertyFeatures.INSTANCE;
}
}
public static class OrientEdgeFeatures extends OrientElementFeatures implements Features.EdgeFeatures {
static final OrientEdgeFeatures INSTANCE = new OrientEdgeFeatures();
private OrientEdgeFeatures() {
}
}
public static class OrientGraphFeatures implements Features.GraphFeatures {
protected final boolean transactionalGraph;
private OrientGraphFeatures(boolean transactionalGraph) {
this.transactionalGraph = transactionalGraph;
}
@Override
public boolean supportsComputer() {
return false;
}
@Override
public boolean supportsTransactions() {
return transactionalGraph;
}
@Override
public boolean supportsPersistence() {
return false;
}
@Override
public boolean supportsThreadedTransactions() {
return false;
}
@Override
public VariableFeatures variables() {
return OrientVariableFeatures.INSTANCE;
}
}
public static class OrientVariableFeatures implements Features.VariableFeatures {
static final OrientVariableFeatures INSTANCE = new OrientVariableFeatures();
@Override
public boolean supportsVariables() {
return false;
}
@Override
public boolean supportsBooleanArrayValues() {
return false;
}
@Override
public boolean supportsBooleanValues() {
return false;
}
@Override
public boolean supportsByteArrayValues() {
return false;
}
@Override
public boolean supportsByteValues() {
return false;
}
@Override
public boolean supportsDoubleArrayValues() {
return false;
}
@Override
public boolean supportsDoubleValues() {
return false;
}
@Override
public boolean supportsFloatArrayValues() {
return false;
}
@Override
public boolean supportsFloatValues() {
return false;
}
@Override
public boolean supportsIntegerArrayValues() {
return false;
}
@Override
public boolean supportsIntegerValues() {
return false;
}
@Override
public boolean supportsLongArrayValues() {
return false;
}
@Override
public boolean supportsLongValues() {
return false;
}
@Override
public boolean supportsMapValues() {
return false;
}
@Override
public boolean supportsMixedListValues() {
return false;
}
@Override
public boolean supportsSerializableValues() {
return false;
}
@Override
public boolean supportsStringArrayValues() {
return false;
}
@Override
public boolean supportsStringValues() {
return false;
}
@Override
public boolean supportsUniformListValues() {
return false;
}
}
public static class OrientVertexPropertyFeatures implements Features.VertexPropertyFeatures {
static final OrientVertexPropertyFeatures INSTANCE = new OrientVertexPropertyFeatures();
@Override
public boolean supportsAnyIds() {
return false;
}
@Override
public boolean supportsCustomIds() {
return false;
}
@Override
public boolean supportsNumericIds() {
return false;
}
@Override
public boolean supportsUserSuppliedIds() {
return false;
}
@Override
public boolean supportsUuidIds() {
return false;
}
@Override
public boolean willAllowId(Object id) {
return false;
}
}
}