@Override public boolean completeEquals(final Function existingObject, final Function newObject) { if (Transformation.class.isInstance(existingObject) && Transformation.class.isInstance(newObject)) { return DMPPersistenceUtil.getTransformationUtils().completeEquals((Transformation) existingObject, (Transformation) newObject); } return super.completeEquals(existingObject, newObject); } }
public DmpDeserializerModule() { super("DmpDeserializerModule"); addDeserializer(Transformation.class, new TransformationDeserializer()); } }
/** * Sets the collection of mappings of the job. * * @param mappingsArg a new collection of mappings */ public void setMappings(final Set<Mapping> mappingsArg) { if (mappingsArg == null && mappings != null) { mappings.clear(); } if (mappingsArg != null) { if (mappings == null) { mappings = Sets.newCopyOnWriteArraySet(); } if (!DMPPersistenceUtil.getMappingUtils().completeEquals(mappings, mappingsArg)) { mappings.clear(); mappings.addAll(mappingsArg); } } }
currentComponent = createNewComponentWithId(currentComponent, currentComponentId.get()); components.put(currentComponentId.get(), currentComponent); } else { TransformationDeserializer.setStringValue(jp, currentComponent, currentFieldName); if (TransformationDeserializer.FUNCTION_KEY.equals(currentFieldName)) { TransformationDeserializer.setFunction(jp, currentComponent); } else if (TransformationDeserializer.PARAMETER_MAPPINGS_KEY.equals(currentFieldName)) { TransformationDeserializer.setParameterMappings(jp, currentComponent); inputComponentsBuilder.addAll(TransformationDeserializer.parseNestedComponent(jp)); outputComponentsBuilder.addAll(TransformationDeserializer.parseNestedComponent(jp)); TransformationDeserializer.assignComponentIds(components); linkInOutComponents(components, inOutComponents); TransformationDeserializer.addComponents(transformation, components);
switch (currentFieldName) { case TransformationDeserializer.FUNCTION_DESCRIPTION_KEY: TransformationDeserializer.setFunctionDescription(jp, transformation); break; case TransformationDeserializer.UUID_KEY: break; default: TransformationDeserializer.setStringValue(jp, transformation, currentFieldName); break; TransformationDeserializer.setParameters(jp, transformation); setComponents(jp, transformation);
@Override public boolean completeEquals(final Object obj) { return Project.class.isInstance(obj) && super.completeEquals(obj) && DMPPersistenceUtil.getDataModelUtils().completeEquals(((Project) obj).getInputDataModel(), getInputDataModel()) && DMPPersistenceUtil.getDataModelUtils().completeEquals(((Project) obj).getOutputDataModel(), getOutputDataModel()) && DMPPersistenceUtil.getMappingUtils().completeEquals(((Project) obj).getMappings(), getMappings()) && DMPPersistenceUtil.getFilterUtils().completeEquals(((Project) obj).getSkipFilter(), getSkipFilter()) && DMPPersistenceUtil.getFunctionUtils().completeEquals(((Project) obj).getFunctions(), getFunctions()) && Objects.equal(((Project) obj).getSelectedRecords(), getSelectedRecords()); } }
/** * Link all input and output components. the input and output components are given as a list of ids and need to be resolved to * actual {@code Component}s. This happens primarily against the components of the current Json or against the database, if * the component wasn't defined within the current Json. * * @param components a map of (id -> {@code Component}) * @param inOutComponents a map of (id -> list ( inIds, outIds ) ) */ private void linkInOutComponents(final Map<String, Component> components, final Map<String, Tuple<List<String>, List<String>>> inOutComponents) { final ComponentService componentService = TransformationDeserializer.getComponentService(deserializationContext); for (final String componentId : components.keySet()) { final Tuple<List<String>, List<String>> inOut = inOutComponents.get(componentId); if (inOut != null) { final List<String> inputComponentIds = inOut.v1(); final List<String> outputComponentIds = inOut.v2(); final List<Component> inputComponents = TransformationDeserializer.lookupComponents(inputComponentIds, components, componentService); final List<Component> outputComponents = TransformationDeserializer .lookupComponents(outputComponentIds, components, componentService); final Component component = components.get(componentId); for (final Component inputComponent : inputComponents) { component.addInputComponent(inputComponent); } for (final Component outputComponent : outputComponents) { component.addOutputComponent(outputComponent); } } } }
@Override public boolean completeEquals(final Object obj) { return Job.class.isInstance(obj) && super.completeEquals(obj) && DMPPersistenceUtil.getMappingUtils().completeEquals(((Job) obj).getMappings(), getMappings()) && DMPPersistenceUtil.getFilterUtils().completeEquals(((Job) obj).getSkipFilter(), getSkipFilter()); } }
if (!DMPPersistenceUtil.getComponentUtils().completeEquals(components, componentsArg)) {
/** * Sets the functions of the project * * @param functionsArg */ public void setFunctions(final Set<Function> functionsArg) { if (functionsArg == null && functions != null) { functions.clear(); } if (functionsArg != null) { if (!DMPPersistenceUtil.getFunctionUtils().completeEquals(functions, functionsArg)) { if (functions == null) { functions = Sets.newCopyOnWriteArraySet(); } functions.clear(); functions.addAll(functionsArg); } } }
@Override public boolean completeEquals(final Object obj) { return MappingAttributePathInstance.class.isInstance(obj) && super.completeEquals(obj) && Objects.equal(((MappingAttributePathInstance) obj).getOrdinal(), getOrdinal()) && DMPPersistenceUtil.getFilterUtils().completeEquals(((MappingAttributePathInstance) obj).getFilter(), getFilter()); } }
@Override public boolean completeEquals(final Object obj) { return Task.class.isInstance(obj) && super.completeEquals(obj) && DMPPersistenceUtil.getDataModelUtils().completeEquals(((Task) obj).getInputDataModel(), getInputDataModel()) && DMPPersistenceUtil.getDataModelUtils().completeEquals(((Task) obj).getOutputDataModel(), getOutputDataModel()) && DMPPersistenceUtil.getJobUtils().completeEquals(((Task) obj).getJob(), getJob()); } }
@Override public boolean completeEquals(final Object obj) { return Transformation.class.isInstance(obj) && super.completeEquals(obj) && DMPPersistenceUtil.getComponentUtils().completeEquals(((Transformation) obj).getComponents(), getComponents()); }
/** * Sets the mappings of the project. * * @param mappingsArg a new collection of mappings */ public void setMappings(final Set<Mapping> mappingsArg) { if (mappingsArg == null && mappings != null) { mappings.clear(); } if (mappingsArg != null) { if (!DMPPersistenceUtil.getMappingUtils().completeEquals(mappings, mappingsArg)) { if (mappings == null) { mappings = Sets.newCopyOnWriteArraySet(); } mappings.clear(); mappings.addAll(mappingsArg); } } }
@Override public boolean completeEquals(final Object obj) { return Component.class.isInstance(obj) && super.completeEquals(obj) && Objects.equal(((Component) obj).getParameterMappings(), getParameterMappings()) && DMPPersistenceUtil.getFunctionUtils().completeEquals(((Component) obj).getFunction(), getFunction()) && Objects.equal(((Component) obj).getInputComponents(), getInputComponents()) && Objects.equal(((Component) obj).getOutputComponents(), getOutputComponents()); }
/** * Sets the input components collections. * * @param inputComponentsArg the new input components collection */ public void setInputComponents(final Set<Component> inputComponentsArg) { if (inputComponentsArg == null && inputComponents != null) { // remove component from input components, if component will be prepared for removal final Set<Component> componentsToBeDeleted = Sets.newCopyOnWriteArraySet(inputComponents); for (final Component inputComponent : componentsToBeDeleted) { inputComponent.removeOutputComponent(this); } inputComponents.clear(); } if (inputComponentsArg != null) { if (inputComponents == null) { inputComponents = Sets.newCopyOnWriteArraySet(); } // if (!inputComponents.equals(inputComponentsArg)) { if (!DMPPersistenceUtil.getComponentUtils().completeEquals(inputComponents, inputComponentsArg)) { inputComponents.clear(); inputComponents.addAll(inputComponentsArg); } for (final Component inputComponent : inputComponentsArg) { inputComponent.addOutputComponent(this); } } }
/** * Sets the output component collection. * * @param outputComponentsArg a new output component collection */ public void setOutputComponents(final Set<Component> outputComponentsArg) { if (outputComponentsArg == null && outputComponents != null) { // remove component from output component, if component will be prepared for removal final Set<Component> componentsToBeDeleted = Sets.newCopyOnWriteArraySet(outputComponents); for (final Component outputComponent : componentsToBeDeleted) { outputComponent.removeInputComponent(this); } outputComponents.clear(); } if (outputComponentsArg != null) { if (outputComponents == null) { outputComponents = Sets.newCopyOnWriteArraySet(); } // if (!outputComponents.equals(outputComponentsArg)) { if (!DMPPersistenceUtil.getComponentUtils().completeEquals(outputComponents, outputComponentsArg)) { outputComponents.clear(); outputComponents.addAll(outputComponentsArg); } for (final Component outputComponent : outputComponentsArg) { outputComponent.addInputComponent(this); } } }
@Override public boolean completeEquals(final Object obj) { return Mapping.class.isInstance(obj) && super.completeEquals(obj) && DMPPersistenceUtil.getMappingAttributePathInstanceUtils().completeEquals(((Mapping) obj).getInputAttributePaths(), getInputAttributePaths()) && DMPPersistenceUtil.getMappingAttributePathInstanceUtils().completeEquals(((Mapping) obj).getOutputAttributePath(), getOutputAttributePath()) && DMPPersistenceUtil.getComponentUtils().completeEquals(((Mapping) obj).getTransformation(), getTransformation()); } }