@Test public void testCopy() { final DecisionTable source = new DecisionTable(new Id(TABLE_ID), new Description(DESCRIPTION), BuiltInType.BOOLEAN.asQName(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), HitPolicy.UNIQUE, SUM, DecisionTableOrientation.RULE_AS_ROW, OUTPUT_LABEL); final DecisionTable target = source.copy(); assertNotNull(target); assertNotEquals(TABLE_ID, target.getId().getValue()); assertEquals(DESCRIPTION, target.getDescription().getValue()); assertEquals(BuiltInType.BOOLEAN.asQName(), target.getTypeRef()); assertTrue(target.getInput().isEmpty()); assertTrue(target.getOutput().isEmpty()); assertTrue(target.getRule().isEmpty()); assertEquals(HitPolicy.UNIQUE, target.getHitPolicy()); assertEquals(SUM, target.getAggregation()); assertEquals(DecisionTableOrientation.RULE_AS_ROW, target.getPreferredOrientation()); assertEquals(OUTPUT_LABEL, target.getOutputLabel()); }
@Override public DecisionTable copy() { final DecisionTable clonedDecisionTable = new DecisionTable(); clonedDecisionTable.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedDecisionTable.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedDecisionTable.componentWidths = new ArrayList<>(componentWidths); clonedDecisionTable.input = input.stream().map(InputClause::copy).collect(Collectors.toList()); clonedDecisionTable.output = output.stream().map(OutputClause::copy).collect(Collectors.toList()); clonedDecisionTable.rule = rule.stream().map(DecisionRule::copy).collect(Collectors.toList()); clonedDecisionTable.annotations = Optional.ofNullable(annotations) .map(annotationEntryList -> annotationEntryList.stream().map(RuleAnnotationClause::copy).collect(Collectors.toList())) .orElse(null); clonedDecisionTable.hitPolicy = hitPolicy; clonedDecisionTable.aggregation = aggregation; clonedDecisionTable.preferredOrientation = preferredOrientation; clonedDecisionTable.outputLabel = outputLabel; return clonedDecisionTable; }
DecisionTable extends Expression { @Override public DecisionTable copy() { final DecisionTable clonedDecisionTable = new DecisionTable(); clonedDecisionTable.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedDecisionTable.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedDecisionTable.componentWidths = new ArrayList<>(componentWidths); clonedDecisionTable.input = input.stream().map(InputClause::copy).collect(Collectors.toList()); clonedDecisionTable.output = output.stream().map(OutputClause::copy).collect(Collectors.toList()); clonedDecisionTable.rule = rule.stream().map(DecisionRule::copy).collect(Collectors.toList()); clonedDecisionTable.annotations = Optional.ofNullable(annotations) .map(annotationEntryList -> annotationEntryList.stream().map(RuleAnnotationClause::copy).collect(Collectors.toList())) .orElse(null); clonedDecisionTable.hitPolicy = hitPolicy; clonedDecisionTable.aggregation = aggregation; clonedDecisionTable.preferredOrientation = preferredOrientation; clonedDecisionTable.outputLabel = outputLabel; return clonedDecisionTable; } }
DecisionTable extends Expression { @Override public DecisionTable copy() { final DecisionTable clonedDecisionTable = new DecisionTable(); clonedDecisionTable.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedDecisionTable.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedDecisionTable.componentWidths = new ArrayList<>(componentWidths); clonedDecisionTable.input = input.stream().map(InputClause::copy).collect(Collectors.toList()); clonedDecisionTable.output = output.stream().map(OutputClause::copy).collect(Collectors.toList()); clonedDecisionTable.rule = rule.stream().map(DecisionRule::copy).collect(Collectors.toList()); clonedDecisionTable.annotations = Optional.ofNullable(annotations) .map(annotationEntryList -> annotationEntryList.stream().map(RuleAnnotationClause::copy).collect(Collectors.toList())) .orElse(null); clonedDecisionTable.hitPolicy = hitPolicy; clonedDecisionTable.aggregation = aggregation; clonedDecisionTable.preferredOrientation = preferredOrientation; clonedDecisionTable.outputLabel = outputLabel; return clonedDecisionTable; } DecisionTable();  DecisionTable(final Id id,
                         final Description description,
                         final QName typeRef,
                         final List<InputClause> input,
                         final List<OutputClause> output,
                         final List<DecisionRule> rule,
                         final HitPolicy hitPolicy,
                         final BuiltinAggregator aggregation,
                         final DecisionTableOrientation preferredOrientation,
                         final String outputLabel); }
DecisionTable extends Expression { @Override public DecisionTable copy() { final DecisionTable clonedDecisionTable = new DecisionTable(); clonedDecisionTable.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedDecisionTable.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedDecisionTable.componentWidths = new ArrayList<>(componentWidths); clonedDecisionTable.input = input.stream().map(InputClause::copy).collect(Collectors.toList()); clonedDecisionTable.output = output.stream().map(OutputClause::copy).collect(Collectors.toList()); clonedDecisionTable.rule = rule.stream().map(DecisionRule::copy).collect(Collectors.toList()); clonedDecisionTable.annotations = Optional.ofNullable(annotations) .map(annotationEntryList -> annotationEntryList.stream().map(RuleAnnotationClause::copy).collect(Collectors.toList())) .orElse(null); clonedDecisionTable.hitPolicy = hitPolicy; clonedDecisionTable.aggregation = aggregation; clonedDecisionTable.preferredOrientation = preferredOrientation; clonedDecisionTable.outputLabel = outputLabel; return clonedDecisionTable; } DecisionTable();  DecisionTable(final Id id,
                         final Description description,
                         final QName typeRef,
                         final List<InputClause> input,
                         final List<OutputClause> output,
                         final List<DecisionRule> rule,
                         final HitPolicy hitPolicy,
                         final BuiltinAggregator aggregation,
                         final DecisionTableOrientation preferredOrientation,
                         final String outputLabel); @Override DecisionTable copy(); List<RuleAnnotationClause> getAnnotations(); List<InputClause> getInput(); List<OutputClause> getOutput(); List<DecisionRule> getRule(); HitPolicy getHitPolicy(); void setHitPolicy(final HitPolicy value); BuiltinAggregator getAggregation(); void setAggregation(final BuiltinAggregator value); DecisionTableOrientation getPreferredOrientation(); void setPreferredOrientation(final DecisionTableOrientation value); String getOutputLabel(); void setOutputLabel(final String value); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
DecisionTable extends Expression { @Override public DecisionTable copy() { final DecisionTable clonedDecisionTable = new DecisionTable(); clonedDecisionTable.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedDecisionTable.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedDecisionTable.componentWidths = new ArrayList<>(componentWidths); clonedDecisionTable.input = input.stream().map(InputClause::copy).collect(Collectors.toList()); clonedDecisionTable.output = output.stream().map(OutputClause::copy).collect(Collectors.toList()); clonedDecisionTable.rule = rule.stream().map(DecisionRule::copy).collect(Collectors.toList()); clonedDecisionTable.annotations = Optional.ofNullable(annotations) .map(annotationEntryList -> annotationEntryList.stream().map(RuleAnnotationClause::copy).collect(Collectors.toList())) .orElse(null); clonedDecisionTable.hitPolicy = hitPolicy; clonedDecisionTable.aggregation = aggregation; clonedDecisionTable.preferredOrientation = preferredOrientation; clonedDecisionTable.outputLabel = outputLabel; return clonedDecisionTable; } DecisionTable();  DecisionTable(final Id id,
                         final Description description,
                         final QName typeRef,
                         final List<InputClause> input,
                         final List<OutputClause> output,
                         final List<DecisionRule> rule,
                         final HitPolicy hitPolicy,
                         final BuiltinAggregator aggregation,
                         final DecisionTableOrientation preferredOrientation,
                         final String outputLabel); @Override DecisionTable copy(); List<RuleAnnotationClause> getAnnotations(); List<InputClause> getInput(); List<OutputClause> getOutput(); List<DecisionRule> getRule(); HitPolicy getHitPolicy(); void setHitPolicy(final HitPolicy value); BuiltinAggregator getAggregation(); void setAggregation(final BuiltinAggregator value); DecisionTableOrientation getPreferredOrientation(); void setPreferredOrientation(final DecisionTableOrientation value); String getOutputLabel(); void setOutputLabel(final String value); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode();  }