@Override public boolean completeEquals(final Object obj) { return Function.class.isInstance(obj) && super.completeEquals(obj) && Objects.equal(((Function) obj).getFunctionType(), getFunctionType()) && Objects.equal(((Function) obj).getParameters(), getParameters()) && Objects.equal(((Function) obj).getFunctionDescription(), getFunctionDescription()); } }
switch (transformationFunction.getFunctionType()) {
private static Function checkFunction(final Component component, final String uuid, final String name, final String description, final String... parameters) { final Function function = component.getFunction(); MatcherAssert.assertThat(function, Matchers.is(Matchers.notNullValue())); MatcherAssert.assertThat(function.getUuid(), Matchers.equalTo(uuid)); MatcherAssert.assertThat(function.getName(), Matchers.equalTo(name)); MatcherAssert.assertThat(function.getDescription(), Matchers.equalTo(description)); MatcherAssert.assertThat(function.getFunctionType(), Matchers.equalTo(FunctionType.Function)); MatcherAssert.assertThat(function.getParameters(), Matchers.hasItems(parameters)); return function; } }
private void replaceFunctionsInComponent(final Component component) throws DMPPersistenceException { if (component == null) { return; } final Function existingComponentFunction = component.getFunction(); final FunctionType componentFunctionFunctionType = existingComponentFunction.getFunctionType(); switch (componentFunctionFunctionType) { case Function: final Function persistentFunction = replaceFunction(existingComponentFunction); component.setFunction(persistentFunction); break; case Transformation: replaceFunctionsInTransformation((Transformation) existingComponentFunction); break; } }
if (transformationFunction != null && transformationFunction.getFunctionType().equals(FunctionType.Transformation)) {
actualComponent.getFunction()); Assert.assertNotNull("function type of component must not be null", expectedComponent.getFunction().getFunctionType()); Assert.assertEquals("the function types are not equal", expectedComponent.getFunction().getFunctionType(), actualComponent.getFunction() .getFunctionType()); switch (expectedComponent.getFunction().getFunctionType()) {