use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaWavesType in project midpoint by Evolveum.
the class ObjectDeltaWaves method toObjectDeltaWavesType.
public ObjectDeltaWavesType toObjectDeltaWavesType() throws SchemaException {
ObjectDeltaWavesType objectDeltaWavesType = new ObjectDeltaWavesType();
for (int i = 0; i < waves.size(); i++) {
ObjectDelta wave = waves.get(i);
if (wave != null) {
ObjectDeltaWaveType objectDeltaWaveType = new ObjectDeltaWaveType();
objectDeltaWaveType.setNumber(i);
objectDeltaWaveType.setDelta(DeltaConvertor.toObjectDeltaType(wave));
objectDeltaWavesType.getWave().add(objectDeltaWaveType);
}
}
return objectDeltaWavesType;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaWavesType in project midpoint by Evolveum.
the class ObjectDeltaWaves method fromObjectDeltaWavesType.
// don't forget to apply provisioning definitions to resulting deltas (it's the client responsibility)
public static <O extends ObjectType> ObjectDeltaWaves<O> fromObjectDeltaWavesType(ObjectDeltaWavesType secondaryDeltas, PrismContext prismContext) throws SchemaException {
if (secondaryDeltas == null) {
return null;
}
ObjectDeltaWaves<O> retval = new ObjectDeltaWaves<>();
int max = 0;
for (ObjectDeltaWaveType odwt : secondaryDeltas.getWave()) {
if (odwt.getNumber() > max) {
max = odwt.getNumber();
}
}
ObjectDelta<O>[] wavesAsArray = new ObjectDelta[max + 1];
for (ObjectDeltaWaveType odwt : secondaryDeltas.getWave()) {
wavesAsArray[odwt.getNumber()] = DeltaConvertor.createObjectDelta(odwt.getDelta(), prismContext);
}
for (int i = 0; i <= max; i++) {
retval.waves.add(wavesAsArray[i]);
}
return retval;
}
Aggregations