public ObjectDeltaObject<O> clone() { ObjectDeltaObject<O> clone = new ObjectDeltaObject<>( CloneUtil.clone(oldObject), CloneUtil.clone(delta), CloneUtil.clone(newObject)); // TODO what about the internals? return clone; }
public ObjectDelta<O> getDelta() { if (odo == null) { return null; } return odo.getObjectDelta(); }
public static void assertHasObject(PrismContainerValue<?> pcv, ItemPath path) { for (PrismValue value : getValues(pcv, path)) { assertHasObject((PrismReferenceValue) value); } }
public <X> ItemDeltaItem<PrismPropertyValue<X>,PrismPropertyDefinition<X>> resolveStructuredProperty( ItemPath resolvePath, PrismPropertyDefinition outputDefinition, ItemPath outputPath, PrismContext prismContext) { ItemDeltaItem<PrismPropertyValue<Structured>,PrismPropertyDefinition<Structured>> thisIdi = (ItemDeltaItem<PrismPropertyValue<Structured>,PrismPropertyDefinition<Structured>>)this; PrismProperty<X> outputPropertyNew = resolveStructuredPropertyItem((PrismProperty<Structured>) thisIdi.getItemNew(), resolvePath, outputDefinition); PrismProperty<X> outputPropertyOld = resolveStructuredPropertyItem((PrismProperty<Structured>) thisIdi.getItemOld(), resolvePath, outputDefinition); PropertyDelta<X> outputDelta = resolveStructuredPropertyDelta((PropertyDelta<Structured>) thisIdi.getDelta(), resolvePath, outputDefinition, outputPath, prismContext); return new ItemDeltaItem<>(outputPropertyOld, outputDelta, outputPropertyNew); }
protected void assertSituation(PrismObject<ShadowType> shadow, SynchronizationSituationType expectedSituation) { if (expectedSituation == null) { PrismAsserts.assertNoItem(shadow, ShadowType.F_SYNCHRONIZATION_SITUATION); } else { PrismAsserts.assertPropertyValue(shadow, ShadowType.F_SYNCHRONIZATION_SITUATION, expectedSituation); } }
public static void resetPrismContext(PrismContextFactory newPrismContextFactory) throws SchemaException, SAXException, IOException { if (prismContextFactory == newPrismContextFactory) { // Exactly the same factory instance, nothing to do. return; } setFactory(newPrismContextFactory); resetPrismContext(); }
public ItemDeltaItem(ItemDeltaItem<V,D> idi) { super(); this.itemOld = idi.getItemOld(); this.itemNew = idi.getItemNew(); this.delta = idi.getDelta(); }
public PrismObject<O> getOldObject() { if (odo == null) { return null; } return odo.getOldObject(); }
public boolean isContainer() { Item<V,D> item = getAnyItem(); if (item != null) { return item instanceof PrismContainer<?>; } if (getDelta() != null) { return getDelta() instanceof ContainerDelta<?>; } return false; }
public ItemDeltaItem<V,D> clone() { ItemDeltaItem<V,D> clone = new ItemDeltaItem<>(); copyValues(clone); return clone; }
public PrismObject<O> getAnyObject() { if (odo == null) { return null; } return odo.getAnyObject(); }
@Override public String toString() { return serializeQuietly(prismContext, object); } };
public static <O extends Objectable> void setDeltaOldValue(PrismObject<O> oldObject, Collection<? extends ItemDelta> itemDeltas) { for(ItemDelta itemDelta: itemDeltas) { setDeltaOldValue(oldObject, itemDelta); } }
public static void assertHasNoTargetName(PrismContainerValue<?> pcv, ItemPath path) { for (PrismValue value : getValues(pcv, path)) { PrismReferenceValue prv = (PrismReferenceValue) value; assertHasNoTargetName(prv); } }
public static void assertHasTargetName(PrismContainerValue<?> pcv, ItemPath path) { for (PrismValue value : getValues(pcv, path)) { PrismReferenceValue prv = (PrismReferenceValue) value; assertHasTargetName(prv); } }
public static void assertHasNoObject(PrismContainerValue<?> pcv, ItemPath path) { for (PrismValue value : getValues(pcv, path)) { assertHasNoObject((PrismReferenceValue) value); } }
private static Object normalizeValuesToDelete(Object root) { if (root instanceof ObjectDeltaObject<?>) { return ((ObjectDeltaObject<?>) root).normalizeValuesToDelete(true); } else if (root instanceof ItemDeltaItem<?, ?>) { // TODO normalize as well return root; } else { return root; } }
@Override public void visit(Visitable visitable) { if (visitable != null && visitable instanceof Item) { assertNotEmpty((Item<?,?>)visitable); } } };
public boolean isProperty() { Item<V,D> item = getAnyItem(); if (item != null) { return item instanceof PrismProperty<?>; } if (getDelta() != null) { return getDelta() instanceof PropertyDelta<?>; } return false; }