@Test public void testGetAssociationByDirection() { final Association association = Bpmn2Factory.eINSTANCE.createAssociation(); association.setAssociationDirection(null); propertyReader = new AssociationPropertyReader(association, bpmnDiagram, definitionResolver); assertEquals(NonDirectionalAssociation.class, propertyReader.getAssociationByDirection()); association.setAssociationDirection(AssociationDirection.NONE); assertEquals(NonDirectionalAssociation.class, propertyReader.getAssociationByDirection()); association.setAssociationDirection(AssociationDirection.ONE); assertEquals(DirectionalAssociation.class, propertyReader.getAssociationByDirection()); }
public Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association> getAssociationByDirection() { return Optional.ofNullable(association.getAssociationDirection()) .filter(d -> !AssociationDirection.NONE.equals(d)) .<Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association>>map(d -> DirectionalAssociation.class) .orElse(NonDirectionalAssociation.class); }
AssociationPropertyReader extends BasePropertyReader implements EdgePropertyReader { public Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association> getAssociationByDirection() { return Optional.ofNullable(association.getAssociationDirection()) .filter(d -> !AssociationDirection.NONE.equals(d)) .<Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association>>map(d -> DirectionalAssociation.class) .orElse(NonDirectionalAssociation.class); } }
AssociationPropertyReader extends BasePropertyReader implements EdgePropertyReader { public Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association> getAssociationByDirection() { return Optional.ofNullable(association.getAssociationDirection()) .filter(d -> !AssociationDirection.NONE.equals(d)) .<Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association>>map(d -> DirectionalAssociation.class) .orElse(NonDirectionalAssociation.class); } AssociationPropertyReader(Association association,
                                     BPMNDiagram diagram,
                                     DefinitionResolver definitionResolver); }
AssociationPropertyReader extends BasePropertyReader implements EdgePropertyReader { public Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association> getAssociationByDirection() { return Optional.ofNullable(association.getAssociationDirection()) .filter(d -> !AssociationDirection.NONE.equals(d)) .<Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association>>map(d -> DirectionalAssociation.class) .orElse(NonDirectionalAssociation.class); } AssociationPropertyReader(Association association,
                                     BPMNDiagram diagram,
                                     DefinitionResolver definitionResolver); @Override String getSourceId(); @Override String getTargetId(); Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association> getAssociationByDirection(); @Override Connection getSourceConnection(); @Override Connection getTargetConnection(); @Override List<Point2D> getControlPoints(); @Override DefinitionResolver getDefinitionResolver(); }
AssociationPropertyReader extends BasePropertyReader implements EdgePropertyReader { public Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association> getAssociationByDirection() { return Optional.ofNullable(association.getAssociationDirection()) .filter(d -> !AssociationDirection.NONE.equals(d)) .<Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association>>map(d -> DirectionalAssociation.class) .orElse(NonDirectionalAssociation.class); } AssociationPropertyReader(Association association,
                                     BPMNDiagram diagram,
                                     DefinitionResolver definitionResolver); @Override String getSourceId(); @Override String getTargetId(); Class<? extends org.kie.workbench.common.stunner.bpmn.definition.Association> getAssociationByDirection(); @Override Connection getSourceConnection(); @Override Connection getTargetConnection(); @Override List<Point2D> getControlPoints(); @Override DefinitionResolver getDefinitionResolver();  }