/** * Copies all values of property {@code Object} deeply. * * @param source * The source to copy from. * @param target * The target to copy {@code source} to. * @throws NullPointerException * if {@code target} is {@code null}. */ @SuppressWarnings("unchecked") private static void copyObject(final List<ObjectType> source, final List<ObjectType> target) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 if ((source!= null)&&(!source.isEmpty())) { for (final Iterator<?> it = source.iterator(); it.hasNext(); ) { final Object next = it.next(); if (next instanceof ObjectType) { // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType target.add(((ObjectType) next).clone()); continue; } // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Object' of class 'com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectListType'.")); } } }
/** * Creates and returns a deep copy of a given {@code javax.xml.bind.JAXBElement<com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType>} instance. * * @param e * The instance to copy or {@code null}. * @return * A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. */ @SuppressWarnings("unchecked") private static JAXBElement<ObjectType> copyOfObjectTypeElement(final JAXBElement<ObjectType> e) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 if (e!= null) { final JAXBElement<ObjectType> copy = new JAXBElement<ObjectType>(e.getName(), e.getDeclaredType(), e.getScope(), e.getValue()); copy.setNil(e.isNil()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType copy.setValue(((((ObjectType) copy.getValue()) == null)?null:((ObjectType) copy.getValue()).clone())); return copy; } return null; }
/** * Creates and returns a deep copy of a given {@code javax.xml.bind.JAXBElement<com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType>} instance. * * @param e * The instance to copy or {@code null}. * @return * A deep copy of {@code e} or {@code null} if {@code e} is {@code null}. */ @SuppressWarnings("unchecked") private static JAXBElement<ObjectType> copyOfObjectTypeElement(final JAXBElement<ObjectType> e) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 if (e!= null) { final JAXBElement<ObjectType> copy = new JAXBElement<ObjectType>(e.getName(), e.getDeclaredType(), e.getScope(), e.getValue()); copy.setNil(e.isNil()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType copy.setValue(((((ObjectType) copy.getValue()) == null)?null:((ObjectType) copy.getValue()).clone())); return copy; } return null; }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public GetObjectResponseType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final GetObjectResponseType clone = ((GetObjectResponseType) super.clone()); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType clone.object = ((this.object == null)?null:((this.getObject() == null)?null:this.getObject().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType clone.result = ((this.result == null)?null:((this.getResult() == null)?null:this.getResult().clone())); return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
/** * Creates a new {@code GetObjectResponseType} instance by deeply copying a given {@code GetObjectResponseType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public GetObjectResponseType(final GetObjectResponseType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'GetObjectResponseType' from 'null'."); } // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType this.object = ((o.object == null)?null:((o.getObject() == null)?null:o.getObject().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType this.result = ((o.result == null)?null:((o.getResult() == null)?null:o.getResult().clone())); }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public CompareResultType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final CompareResultType clone = ((CompareResultType) super.clone()); // CClassInfo: com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType clone.currentToProvided = ((this.currentToProvided == null)?null:((this.getCurrentToProvided() == null)?null:this.getCurrentToProvided().clone())); // CClassInfo: com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType clone.providedToCurrent = ((this.providedToCurrent == null)?null:((this.getProvidedToCurrent() == null)?null:this.getProvidedToCurrent().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType clone.normalizedObject = ((this.normalizedObject == null)?null:((this.getNormalizedObject() == null)?null:this.getNormalizedObject().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType clone.currentObject = ((this.currentObject == null)?null:((this.getCurrentObject() == null)?null:this.getCurrentObject().clone())); return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
/** * Creates a new {@code CompareResultType} instance by deeply copying a given {@code CompareResultType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public CompareResultType(final CompareResultType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'CompareResultType' from 'null'."); } // CClassInfo: com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType this.currentToProvided = ((o.currentToProvided == null)?null:((o.getCurrentToProvided() == null)?null:o.getCurrentToProvided().clone())); // CClassInfo: com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType this.providedToCurrent = ((o.providedToCurrent == null)?null:((o.getProvidedToCurrent() == null)?null:o.getProvidedToCurrent().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType this.normalizedObject = ((o.normalizedObject == null)?null:((o.getNormalizedObject() == null)?null:o.getNormalizedObject().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType this.currentObject = ((o.currentObject == null)?null:((o.getCurrentObject() == null)?null:o.getCurrentObject().clone())); }
addObject(objectType.clone());
private List<ApprovalRequest<T>> getApprovalRequests(ModelContext<?> modelContext, PcpAspectConfigurationType config, ObjectDelta<? extends ObjectType> change, Task taskFromModel, OperationResult result) { if (change.getChangeType() != ChangeType.ADD) { return null; } T objectType = (T) change.getObjectToAdd().asObjectable().clone(); if (objectType.getOid() == null) { String newOid = OidUtil.generateOid(); objectType.setOid(newOid); ((LensFocusContext<?>) modelContext.getFocusContext()).setOid(newOid); } change.setObjectToAdd(null); // make the change empty return Arrays.asList(createApprovalRequest(config, objectType, modelContext, taskFromModel, result)); }