public Model createCopy() { AttributeModel copy = new AttributeModel(name, value); copy.setType(type); return copy; }
private AttributeModel parseAttribute(Element element) { AttributeModel attribute = new AttributeModel(element.getAttribute("name"), parseAttributeValue(element)); attribute.setType(element.getAttribute("type")); return attribute; }
public void merge(Model model) { AttributeModel attribute = (AttributeModel) model; setValue(merge(getValue(), attribute.getValue())); setType(merge(getType(), attribute.getType())); }
public Model createCopy() { AttributeModel copy = new AttributeModel(name, value); copy.setType(type); return copy; }
private AttributeModel parseAttribute(Element element) { AttributeModel attribute = new AttributeModel(element.getAttribute("name"), parseAttributeValue(element)); attribute.setType(element.getAttribute("type")); return attribute; }
private AttributeModel parseAttribute(Element element) { AttributeModel attribute = new AttributeModel(element.getAttribute("name"), parseAttributeValue(element)); attribute.setType(element.getAttribute("type")); return attribute; }
public void merge(Model model) { AttributeModel attribute = (AttributeModel) model; setValue(merge(getValue(), attribute.getValue())); setType(merge(getType(), attribute.getType())); }
public void merge(Model model) { AttributeModel attribute = (AttributeModel) model; setValue(merge(getValue(), attribute.getValue())); setType(merge(getType(), attribute.getType())); }
public void testMerge() { AttributeModel child = new AttributeModel("child", "childvalue"); AttributeModel parent = new AttributeModel("child", "childvalue"); parent.setType("string"); child.merge(parent); assertEquals("string", child.getType()); }
public void testMergeAttributes() { FlowModel child = new FlowModel(); FlowModel parent = new FlowModel(); child.setAttributes(asList(new AttributeModel("name", "value"))); AttributeModel parentAttribute1 = new AttributeModel("name", "value"); parentAttribute1.setType("type"); AttributeModel parentAttribute2 = new AttributeModel("name2", "value2"); parentAttribute2.setType("type2"); parent.setAttributes(asList(parentAttribute1, parentAttribute2)); child.merge(parent); assertEquals(2, child.getAttributes().size()); assertEquals("name", child.getAttributes().get(0).getName()); assertEquals("type", child.getAttributes().get(0).getType()); assertEquals("name2", child.getAttributes().get(1).getName()); assertEquals("type2", child.getAttributes().get(1).getType()); }
public void testCustomFlowAttribute() { AttributeModel attribute1 = new AttributeModel("foo", "bar"); AttributeModel attribute2 = new AttributeModel("number", "1"); attribute2.setType("integer"); model.setAttributes(asList(attribute1, attribute2)); model.setStates(asList(new EndStateModel("end"))); Flow flow = getFlow(model); assertEquals("bar", flow.getAttributes().get("foo")); assertEquals(1, flow.getAttributes().get("number")); }