-
Notifications
You must be signed in to change notification settings - Fork 188
/
DummyContainerImpl.java
628 lines (487 loc) · 20.2 KB
/
DummyContainerImpl.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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
/*
* Copyright (c) 2019 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
package com.evolveum.midpoint.prism.impl.item;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import javax.xml.namespace.QName;
import com.evolveum.midpoint.prism.CloneStrategy;
import com.evolveum.midpoint.prism.ConsistencyCheckScope;
import com.evolveum.midpoint.prism.Containerable;
import com.evolveum.midpoint.prism.Item;
import com.evolveum.midpoint.prism.ItemDefinition;
import com.evolveum.midpoint.prism.Itemable;
import com.evolveum.midpoint.prism.PartiallyResolvedItem;
import com.evolveum.midpoint.prism.PrismContainer;
import com.evolveum.midpoint.prism.PrismContainerDefinition;
import com.evolveum.midpoint.prism.PrismContainerValue;
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.PrismProperty;
import com.evolveum.midpoint.prism.PrismReference;
import com.evolveum.midpoint.prism.PrismValue;
import com.evolveum.midpoint.prism.Visitor;
import com.evolveum.midpoint.prism.delta.ContainerDelta;
import com.evolveum.midpoint.prism.delta.ItemDelta;
import com.evolveum.midpoint.prism.equivalence.EquivalenceStrategy;
import com.evolveum.midpoint.prism.equivalence.ParameterizedEquivalenceStrategy;
import com.evolveum.midpoint.prism.path.ItemName;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.util.exception.SchemaException;
import org.jetbrains.annotations.NotNull;
/**
* @author semancik
*
*/
public class DummyContainerImpl<C extends Containerable> implements PrismContainer<C> {
private static final long serialVersionUID = 1L;
@NotNull private final ItemPath path;
private final PrismContainer<C> realContainer;
public DummyContainerImpl(PrismContainer<C> realContainer, @NotNull ItemPath path) {
this.realContainer = realContainer;
this.path = path;
}
public void accept(Visitor visitor) {
realContainer.accept(visitor);
}
public boolean hasCompleteDefinition() {
return realContainer.hasCompleteDefinition();
}
public ItemName getElementName() {
return realContainer.getElementName();
}
public Class<C> getCompileTimeClass() {
return realContainer.getCompileTimeClass();
}
public boolean canRepresent(@NotNull Class<?> compileTimeClass) {
return realContainer.canRepresent(compileTimeClass);
}
public void setElementName(QName elementName) {
realContainer.setElementName(elementName);
}
public boolean canRepresent(QName type) {
return realContainer.canRepresent(type);
}
public String getDisplayName() {
return realContainer.getDisplayName();
}
@NotNull
public Collection<C> getRealValues() {
return realContainer.getRealValues();
}
@NotNull
public C getRealValue() {
return realContainer.getRealValue();
}
public void setValue(@NotNull PrismContainerValue<C> value) throws SchemaException {
realContainer.setValue(value);
}
@NotNull
public PrismContainerValue<C> getValue() {
return realContainer.getValue();
}
public PrismContainerValue<C> getValue(Long id) {
return realContainer.getValue(id);
}
public <T> void setPropertyRealValue(QName propertyName, T realValue) throws SchemaException {
realContainer.setPropertyRealValue(propertyName, realValue);
}
public String getHelp() {
return realContainer.getHelp();
}
public <C extends Containerable> void setContainerRealValue(QName containerName, C realValue)
throws SchemaException {
realContainer.setContainerRealValue(containerName, realValue);
}
public <T> void setPropertyRealValues(QName propertyName, T... realValues) throws SchemaException {
realContainer.setPropertyRealValues(propertyName, realValues);
}
public <T> T getPropertyRealValue(ItemPath propertyPath, Class<T> type) {
return realContainer.getPropertyRealValue(propertyPath, type);
}
public void add(Item<?, ?> item) throws SchemaException {
realContainer.add(item);
}
public boolean isIncomplete() {
return realContainer.isIncomplete();
}
public PrismContainerValue<C> createNewValue() {
return realContainer.createNewValue();
}
public void mergeValues(PrismContainer<C> other) throws SchemaException {
realContainer.mergeValues(other);
}
public void mergeValues(Collection<PrismContainerValue<C>> otherValues) throws SchemaException {
realContainer.mergeValues(otherValues);
}
public void mergeValue(PrismContainerValue<C> otherValue) throws SchemaException {
realContainer.mergeValue(otherValue);
}
public void trim() {
realContainer.trim();
}
public PrismContainerDefinition<C> getDefinition() {
return realContainer.getDefinition();
}
public void setDefinition(PrismContainerDefinition<C> definition) {
realContainer.setDefinition(definition);
}
public void setIncomplete(boolean incomplete) {
realContainer.setIncomplete(incomplete);
}
public void applyDefinition(PrismContainerDefinition<C> definition) throws SchemaException {
realContainer.applyDefinition(definition);
}
public PrismContainerValue<?> getParent() {
throw new UnsupportedOperationException();
}
public <IV extends PrismValue, ID extends ItemDefinition, I extends Item<IV, ID>> I findItem(
QName itemQName, Class<I> type) {
return realContainer.findItem(itemQName, type);
}
public Object find(ItemPath path) {
return realContainer.find(path);
}
public void setParent(PrismContainerValue<?> parentValue) {
throw new UnsupportedOperationException();
}
public <IV extends PrismValue, ID extends ItemDefinition> PartiallyResolvedItem<IV, ID> findPartial(
ItemPath path) {
return realContainer.findPartial(path);
}
public <IV extends PrismValue, ID extends ItemDefinition, I extends Item<IV, ID>> I findCreateItem(
QName itemQName, Class<I> type, boolean create) throws SchemaException {
return realContainer.findCreateItem(itemQName, type, create);
}
@NotNull
public ItemPath getPath() {
return path;
}
public <IV extends PrismValue, ID extends ItemDefinition, I extends Item<IV, ID>> I findItem(
ItemPath path, Class<I> type) {
return realContainer.findItem(path, type);
}
public <IV extends PrismValue, ID extends ItemDefinition> Item<IV, ID> findItem(ItemPath path) {
return realContainer.findItem(path);
}
@NotNull
public Map<String, Object> getUserData() {
return realContainer.getUserData();
}
public boolean containsItem(ItemPath itemPath, boolean acceptEmptyItem) throws SchemaException {
return realContainer.containsItem(itemPath, acceptEmptyItem);
}
public <IV extends PrismValue, ID extends ItemDefinition, I extends Item<IV, ID>> I findCreateItem(
ItemPath itemPath, Class<I> type, ID itemDefinition, boolean create) throws SchemaException {
return realContainer.findCreateItem(itemPath, type, itemDefinition, create);
}
public <T> T getUserData(String key) {
return realContainer.getUserData(key);
}
public void setUserData(String key, Object value) {
realContainer.setUserData(key, value);
}
public PrismContainerValue<C> findValue(long id) {
return realContainer.findValue(id);
}
@NotNull
public List<PrismContainerValue<C>> getValues() {
return realContainer.getValues();
}
public <T extends Containerable> PrismContainer<T> findContainer(ItemPath path) {
return realContainer.findContainer(path);
}
public <T> PrismProperty<T> findProperty(ItemPath path) {
return realContainer.findProperty(path);
}
public PrismReference findReference(ItemPath path) {
return realContainer.findReference(path);
}
public <IV extends PrismValue, ID extends ItemDefinition, I extends Item<IV, ID>> I findOrCreateItem(
ItemPath containerPath, Class<I> type) throws SchemaException {
return realContainer.findOrCreateItem(containerPath, type);
}
public int size() {
return realContainer.size();
}
public PrismContainerValue<C> getAnyValue() {
return realContainer.getAnyValue();
}
public <IV extends PrismValue, ID extends ItemDefinition, I extends Item<IV, ID>> I findOrCreateItem(
ItemPath containerPath, Class<I> type, ID definition) throws SchemaException {
return realContainer.findOrCreateItem(containerPath, type, definition);
}
public <T extends Containerable> PrismContainer<T> findOrCreateContainer(ItemPath containerPath)
throws SchemaException {
return realContainer.findOrCreateContainer(containerPath);
}
public <T> PrismProperty<T> findOrCreateProperty(ItemPath propertyPath) throws SchemaException {
return realContainer.findOrCreateProperty(propertyPath);
}
public PrismReference findOrCreateReference(ItemPath propertyPath) throws SchemaException {
return realContainer.findOrCreateReference(propertyPath);
}
public void remove(Item<?, ?> item) {
realContainer.remove(item);
}
public void removeProperty(ItemPath path) {
realContainer.removeProperty(path);
}
public void removeContainer(ItemPath path) {
realContainer.removeContainer(path);
}
public void removeReference(ItemPath path) {
realContainer.removeReference(path);
}
public <IV extends PrismValue, ID extends ItemDefinition, I extends Item<IV, ID>> void removeItem(
ItemPath path, Class<I> itemType) {
realContainer.removeItem(path, itemType);
}
public ContainerDelta<C> createDelta() {
return realContainer.createDelta();
}
public boolean isSingleValue() {
return realContainer.isSingleValue();
}
public boolean add(@NotNull PrismContainerValue<C> newValue, boolean checkUniqueness) throws SchemaException {
return realContainer.add(newValue, checkUniqueness);
}
public ContainerDelta<C> createDelta(ItemPath path) {
return realContainer.createDelta(path);
}
public boolean isEmpty() {
return realContainer.isEmpty();
}
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions,
boolean prohibitRaw, ConsistencyCheckScope scope) {
realContainer.checkConsistenceInternal(rootItem, requireDefinitions, prohibitRaw, scope);
}
public void assertDefinitions(boolean tolarateRaw, String sourceDescription) throws SchemaException {
realContainer.assertDefinitions(tolarateRaw, sourceDescription);
}
public boolean add(@NotNull PrismContainerValue<C> newValue) throws SchemaException {
return realContainer.add(newValue);
}
public ContainerDelta<C> diff(PrismContainer<C> other) {
return realContainer.diff(other);
}
public ContainerDelta<C> diff(PrismContainer<C> other, ParameterizedEquivalenceStrategy strategy) {
return realContainer.diff(other, strategy);
}
public List<? extends ItemDelta> diffModifications(PrismContainer<C> other) {
return realContainer.diffModifications(other);
}
public boolean add(@NotNull PrismContainerValue<C> newValue, @NotNull EquivalenceStrategy equivalenceStrategy)
throws SchemaException {
return realContainer.add(newValue, equivalenceStrategy);
}
public List<? extends ItemDelta> diffModifications(PrismContainer<C> other,
ParameterizedEquivalenceStrategy strategy) {
return realContainer.diffModifications(other, strategy);
}
public PrismContainer<C> clone() {
return new DummyContainerImpl<>(realContainer, path);
}
public PrismContainer<C> cloneComplex(CloneStrategy strategy) {
return new DummyContainerImpl<>(realContainer, path);
}
public PrismContainerDefinition<C> deepCloneDefinition(boolean ultraDeep,
Consumer<ItemDefinition> postCloneAction) {
return realContainer.deepCloneDefinition(ultraDeep, postCloneAction);
}
public void accept(Visitor visitor, ItemPath path, boolean recursive) {
realContainer.accept(visitor, path, recursive);
}
public boolean addAll(Collection<PrismContainerValue<C>> newValues) throws SchemaException {
return realContainer.addAll(newValues);
}
public boolean equivalent(Object obj) {
return realContainer.equivalent(obj);
}
public String toString() {
return "Dummy" + realContainer.toString();
}
public boolean addAll(Collection<PrismContainerValue<C>> newValues, EquivalenceStrategy strategy)
throws SchemaException {
return realContainer.addAll(newValues, strategy);
}
@Override
public boolean addAll(Collection<PrismContainerValue<C>> newValues, boolean checkUniqueness, EquivalenceStrategy strategy)
throws SchemaException {
return realContainer.addAll(newValues, checkUniqueness, strategy);
}
public String debugDump(int indent) {
return realContainer.debugDump(indent);
}
public boolean remove(PrismContainerValue<C> value) {
return realContainer.remove(value);
}
public boolean remove(PrismContainerValue<C> value, @NotNull EquivalenceStrategy strategy) {
return realContainer.remove(value, strategy);
}
public void trimDefinitionTree(Collection<? extends ItemPath> alwaysKeep) {
realContainer.trimDefinitionTree(alwaysKeep);
}
public boolean removeAll(Collection<PrismContainerValue<C>> values) {
return realContainer.removeAll(values);
}
public void clear() {
realContainer.clear();
}
public void replaceAll(Collection<PrismContainerValue<C>> newValues, EquivalenceStrategy strategy)
throws SchemaException {
realContainer.replaceAll(newValues, strategy);
}
public void replace(PrismContainerValue<C> newValue) throws SchemaException {
realContainer.replace(newValue);
}
public boolean equals(Object obj) {
return realContainer.equals(obj);
}
public boolean equals(Object obj, @NotNull EquivalenceStrategy equivalenceStrategy) {
return realContainer.equals(obj, equivalenceStrategy);
}
public boolean equals(Object obj, @NotNull ParameterizedEquivalenceStrategy equivalenceStrategy) {
return realContainer.equals(obj, equivalenceStrategy);
}
public int hashCode() {
return realContainer.hashCode();
}
public int hashCode(@NotNull EquivalenceStrategy equivalenceStrategy) {
return realContainer.hashCode(equivalenceStrategy);
}
public int hashCode(@NotNull ParameterizedEquivalenceStrategy equivalenceStrategy) {
return realContainer.hashCode(equivalenceStrategy);
}
public boolean contains(PrismContainerValue<C> value) {
return realContainer.contains(value);
}
public boolean contains(PrismContainerValue<C> value, @NotNull EquivalenceStrategy strategy) {
return realContainer.contains(value, strategy);
}
public boolean contains(PrismContainerValue<C> value, EquivalenceStrategy strategy,
Comparator<PrismContainerValue<C>> comparator) {
return realContainer.contains(value, strategy, comparator);
}
public boolean containsEquivalentValue(PrismContainerValue<C> value) {
return realContainer.containsEquivalentValue(value);
}
public boolean containsEquivalentValue(PrismContainerValue<C> value,
Comparator<PrismContainerValue<C>> comparator) {
return realContainer.containsEquivalentValue(value, comparator);
}
public PrismContainerValue<C> findValue(PrismContainerValue<C> value, @NotNull EquivalenceStrategy strategy) {
return realContainer.findValue(value, strategy);
}
public boolean valuesEqual(Collection<PrismContainerValue<C>> matchValues,
Comparator<PrismContainerValue<C>> comparator) {
return realContainer.valuesEqual(matchValues, comparator);
}
public ItemDelta<PrismContainerValue<C>, PrismContainerDefinition<C>> diff(
Item<PrismContainerValue<C>, PrismContainerDefinition<C>> other) {
return realContainer.diff(other);
}
public ItemDelta<PrismContainerValue<C>, PrismContainerDefinition<C>> diff(
Item<PrismContainerValue<C>, PrismContainerDefinition<C>> other,
@NotNull ParameterizedEquivalenceStrategy strategy) {
return realContainer.diff(other, strategy);
}
public Collection<PrismContainerValue<C>> getClonedValues() {
return realContainer.getClonedValues();
}
public void normalize() {
realContainer.normalize();
}
public void merge(Item<PrismContainerValue<C>, PrismContainerDefinition<C>> otherItem)
throws SchemaException {
realContainer.merge(otherItem);
}
public void acceptParentVisitor(@NotNull Visitor visitor) {
realContainer.acceptParentVisitor(visitor);
}
public void recomputeAllValues() {
realContainer.recomputeAllValues();
}
public void filterValues(Function<PrismContainerValue<C>, Boolean> function) {
realContainer.filterValues(function);
}
public void applyDefinition(PrismContainerDefinition<C> definition, boolean force)
throws SchemaException {
realContainer.applyDefinition(definition, force);
}
public void revive(PrismContext prismContext) throws SchemaException {
realContainer.revive(prismContext);
}
public void checkConsistence(boolean requireDefinitions, ConsistencyCheckScope scope) {
realContainer.checkConsistence(requireDefinitions, scope);
}
public void checkConsistence(boolean requireDefinitions, boolean prohibitRaw) {
realContainer.checkConsistence(requireDefinitions, prohibitRaw);
}
public void checkConsistence(boolean requireDefinitions, boolean prohibitRaw,
ConsistencyCheckScope scope) {
realContainer.checkConsistence(requireDefinitions, prohibitRaw, scope);
}
public void checkConsistence() {
realContainer.checkConsistence();
}
public void checkConsistence(ConsistencyCheckScope scope) {
realContainer.checkConsistence(scope);
}
public void assertDefinitions() throws SchemaException {
realContainer.assertDefinitions();
}
public void assertDefinitions(String sourceDescription) throws SchemaException {
realContainer.assertDefinitions(sourceDescription);
}
public boolean isRaw() {
return realContainer.isRaw();
}
public boolean hasRaw() {
return realContainer.hasRaw();
}
public boolean hasNoValues() {
return realContainer.hasNoValues();
}
public boolean isOperational() {
return realContainer.isOperational();
}
public boolean isImmutable() {
return realContainer.isImmutable();
}
public void setImmutable(boolean immutable) {
realContainer.setImmutable(immutable);
}
public void checkImmutability() {
realContainer.checkImmutability();
}
public void modifyUnfrozen(Runnable mutator) {
realContainer.modifyUnfrozen(mutator);
}
public void modifyUnfrozen(
Consumer<Item<PrismContainerValue<C>, PrismContainerDefinition<C>>> mutator) {
realContainer.modifyUnfrozen(mutator);
}
@NotNull
public Collection<PrismValue> getAllValues(ItemPath path) {
return realContainer.getAllValues(path);
}
public PrismContext getPrismContext() {
return realContainer.getPrismContext();
}
public PrismContext getPrismContextLocal() {
return realContainer.getPrismContextLocal();
}
public void setPrismContext(PrismContext prismContext) {
realContainer.setPrismContext(prismContext);
}
public Long getHighestId() {
return realContainer.getHighestId();
}
}