@Test public void testCopy() { final Binding source = new Binding(); final InformationItem informationItem = new InformationItem(new Id(ITEM_ID), new Description(DESCRIPTION), new Name(INFORMATION_ITEM_NAME), BuiltInType.BOOLEAN.asQName()); source.setParameter(informationItem); final Binding target = source.copy(); assertNotNull(target); assertNull(target.getExpression()); assertNotNull(target.getParameter()); assertNotEquals(ITEM_ID, target.getParameter().getId().getValue()); assertEquals(DESCRIPTION, target.getParameter().getDescription().getValue()); assertEquals(INFORMATION_ITEM_NAME, target.getParameter().getName().getValue()); assertEquals(BuiltInType.BOOLEAN.asQName(), target.getParameter().getTypeRef()); }
public Binding copy() { final Binding bindingCloned = new Binding(); bindingCloned.parameter = Optional.ofNullable(parameter).map(InformationItem::copy).orElse(null); bindingCloned.expression = Optional.ofNullable(expression).map(Expression::copy).orElse(null); return bindingCloned; }
Binding extends DMNModelInstrumentedBase implements HasExpression,
                                                                 HasTypeRefs,
                                                                 HasVariable<InformationItem> { public Binding copy() { final Binding bindingCloned = new Binding(); bindingCloned.parameter = Optional.ofNullable(parameter).map(InformationItem::copy).orElse(null); bindingCloned.expression = Optional.ofNullable(expression).map(Expression::copy).orElse(null); return bindingCloned; } }
Binding extends DMNModelInstrumentedBase implements HasExpression,
                                                                 HasTypeRefs,
                                                                 HasVariable<InformationItem> { public Binding copy() { final Binding bindingCloned = new Binding(); bindingCloned.parameter = Optional.ofNullable(parameter).map(InformationItem::copy).orElse(null); bindingCloned.expression = Optional.ofNullable(expression).map(Expression::copy).orElse(null); return bindingCloned; }  }
Binding extends DMNModelInstrumentedBase implements HasExpression,
                                                                 HasTypeRefs,
                                                                 HasVariable<InformationItem> { public Binding copy() { final Binding bindingCloned = new Binding(); bindingCloned.parameter = Optional.ofNullable(parameter).map(InformationItem::copy).orElse(null); bindingCloned.expression = Optional.ofNullable(expression).map(Expression::copy).orElse(null); return bindingCloned; }  Binding copy(); InformationItem getParameter(); void setParameter(final InformationItem value); @Override //Proxy for getParameter() to allow use as HasVariable InformationItem getVariable(); @Override //Proxy for setParameter(..) to allow use as HasVariable void setVariable(final InformationItem informationItem); @Override Expression getExpression(); @Override void setExpression(final Expression value); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); @Override boolean equals(final Object o); @Override int hashCode(); @Override List<HasTypeRef> getHasTypeRefs(); }
Binding extends DMNModelInstrumentedBase implements HasExpression,
                                                                 HasTypeRefs,
                                                                 HasVariable<InformationItem> { public Binding copy() { final Binding bindingCloned = new Binding(); bindingCloned.parameter = Optional.ofNullable(parameter).map(InformationItem::copy).orElse(null); bindingCloned.expression = Optional.ofNullable(expression).map(Expression::copy).orElse(null); return bindingCloned; }  Binding copy(); InformationItem getParameter(); void setParameter(final InformationItem value); @Override //Proxy for getParameter() to allow use as HasVariable InformationItem getVariable(); @Override //Proxy for setParameter(..) to allow use as HasVariable void setVariable(final InformationItem informationItem); @Override Expression getExpression(); @Override void setExpression(final Expression value); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); @Override boolean equals(final Object o); @Override int hashCode(); @Override List<HasTypeRef> getHasTypeRefs();  }