@Test public void testCopy() { final FunctionDefinition source = new FunctionDefinition(); source.setId(new Id(FUNCTION_ID)); source.setDescription(new Description(DESCRIPTION)); source.setTypeRef(BuiltInType.BOOLEAN.asQName()); source.setKind(FunctionDefinition.Kind.JAVA); final FunctionDefinition target = source.copy(); assertNotNull(target); assertNotEquals(FUNCTION_ID, target.getId().getValue()); assertEquals(DESCRIPTION, target.getDescription().getValue()); assertEquals(BuiltInType.BOOLEAN.asQName(), target.getTypeRef()); assertEquals(FunctionDefinition.Kind.JAVA, target.getKind()); }
@Override public FunctionDefinition copy() { final FunctionDefinition clonedFunctionDefinition = new FunctionDefinition(); clonedFunctionDefinition.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedFunctionDefinition.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedFunctionDefinition.componentWidths = new ArrayList<>(componentWidths); clonedFunctionDefinition.expression = Optional.ofNullable(expression).map(Expression::copy).orElse(null); clonedFunctionDefinition.formalParameter = cloneFormalParameterList(); clonedFunctionDefinition.kind = kind; clonedFunctionDefinition.getAdditionalAttributes().putAll(cloneAdditionalAttributes()); return clonedFunctionDefinition; }
FunctionDefinition extends Expression implements HasExpression { @Override public FunctionDefinition copy() { final FunctionDefinition clonedFunctionDefinition = new FunctionDefinition(); clonedFunctionDefinition.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedFunctionDefinition.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedFunctionDefinition.componentWidths = new ArrayList<>(componentWidths); clonedFunctionDefinition.expression = Optional.ofNullable(expression).map(Expression::copy).orElse(null); clonedFunctionDefinition.formalParameter = cloneFormalParameterList(); clonedFunctionDefinition.kind = kind; clonedFunctionDefinition.getAdditionalAttributes().putAll(cloneAdditionalAttributes()); return clonedFunctionDefinition; } }
FunctionDefinition extends Expression implements HasExpression { @Override public FunctionDefinition copy() { final FunctionDefinition clonedFunctionDefinition = new FunctionDefinition(); clonedFunctionDefinition.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedFunctionDefinition.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedFunctionDefinition.componentWidths = new ArrayList<>(componentWidths); clonedFunctionDefinition.expression = Optional.ofNullable(expression).map(Expression::copy).orElse(null); clonedFunctionDefinition.formalParameter = cloneFormalParameterList(); clonedFunctionDefinition.kind = kind; clonedFunctionDefinition.getAdditionalAttributes().putAll(cloneAdditionalAttributes()); return clonedFunctionDefinition; } FunctionDefinition();  FunctionDefinition(final Id id,
                              final Description description,
                              final QName typeRef,
                              final Expression expression); }
FunctionDefinition extends Expression implements HasExpression { @Override public FunctionDefinition copy() { final FunctionDefinition clonedFunctionDefinition = new FunctionDefinition(); clonedFunctionDefinition.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedFunctionDefinition.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedFunctionDefinition.componentWidths = new ArrayList<>(componentWidths); clonedFunctionDefinition.expression = Optional.ofNullable(expression).map(Expression::copy).orElse(null); clonedFunctionDefinition.formalParameter = cloneFormalParameterList(); clonedFunctionDefinition.kind = kind; clonedFunctionDefinition.getAdditionalAttributes().putAll(cloneAdditionalAttributes()); return clonedFunctionDefinition; } FunctionDefinition();  FunctionDefinition(final Id id,
                              final Description description,
                              final QName typeRef,
                              final Expression expression); @Override FunctionDefinition copy(); @Override Expression getExpression(); @Override void setExpression(final Expression expression); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); List<InformationItem> getFormalParameter(); Kind getKind(); void setKind(Kind kind); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
FunctionDefinition extends Expression implements HasExpression { @Override public FunctionDefinition copy() { final FunctionDefinition clonedFunctionDefinition = new FunctionDefinition(); clonedFunctionDefinition.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedFunctionDefinition.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedFunctionDefinition.componentWidths = new ArrayList<>(componentWidths); clonedFunctionDefinition.expression = Optional.ofNullable(expression).map(Expression::copy).orElse(null); clonedFunctionDefinition.formalParameter = cloneFormalParameterList(); clonedFunctionDefinition.kind = kind; clonedFunctionDefinition.getAdditionalAttributes().putAll(cloneAdditionalAttributes()); return clonedFunctionDefinition; } FunctionDefinition();  FunctionDefinition(final Id id,
                              final Description description,
                              final QName typeRef,
                              final Expression expression); @Override FunctionDefinition copy(); @Override Expression getExpression(); @Override void setExpression(final Expression expression); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); List<InformationItem> getFormalParameter(); Kind getKind(); void setKind(Kind kind); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode();  }