@Test public void testSetValue() { List<DefaultImport> defaultImports = new ArrayList<>(); defaultImports.add(new DefaultImport(CLASS_NAME + 1)); defaultImports.add(new DefaultImport(CLASS_NAME + 2)); defaultImports.add(new DefaultImport(CLASS_NAME + 3)); BaseElement baseElement = bpmn2.createProcess(); CustomElement.defaultImports.of(baseElement).set(defaultImports); List<DefaultImport> result = CustomElement.defaultImports.of(baseElement).get(); assertEquals(3, result.size()); assertEquals(CLASS_NAME + 1, result.get(0).getClassName()); assertEquals(CLASS_NAME + 2, result.get(1).getClassName()); assertEquals(CLASS_NAME + 3, result.get(2).getClassName()); }
@Override public void setValue(BaseElement element, List<DefaultImport> value) { value.stream() .map(DefaultImportsElement::extensionOf) .forEach(getExtensionElements(element)::add); }
DefaultImportsElement extends ElementDefinition<List<DefaultImport>> { @Override public void setValue(BaseElement element, List<DefaultImport> value) { value.stream() .map(DefaultImportsElement::extensionOf) .forEach(getExtensionElements(element)::add); } }
DefaultImportsElement extends ElementDefinition<List<DefaultImport>> { @Override public void setValue(BaseElement element, List<DefaultImport> value) { value.stream() .map(DefaultImportsElement::extensionOf) .forEach(getExtensionElements(element)::add); } DefaultImportsElement(String name); }
DefaultImportsElement extends ElementDefinition<List<DefaultImport>> { @Override public void setValue(BaseElement element, List<DefaultImport> value) { value.stream() .map(DefaultImportsElement::extensionOf) .forEach(getExtensionElements(element)::add); } DefaultImportsElement(String name); @Override List<DefaultImport> getValue(BaseElement element); @Override void setValue(BaseElement element, List<DefaultImport> value); static FeatureMap.Entry extensionOf(DefaultImport defaultImport); static ImportType importTypeDataOf(DefaultImport defaultImport); }
DefaultImportsElement extends ElementDefinition<List<DefaultImport>> { @Override public void setValue(BaseElement element, List<DefaultImport> value) { value.stream() .map(DefaultImportsElement::extensionOf) .forEach(getExtensionElements(element)::add); } DefaultImportsElement(String name); @Override List<DefaultImport> getValue(BaseElement element); @Override void setValue(BaseElement element, List<DefaultImport> value); static FeatureMap.Entry extensionOf(DefaultImport defaultImport); static ImportType importTypeDataOf(DefaultImport defaultImport);  }