@Test public void testGetAllAspects() { PropertyElementDescriptors descriptors = new PropertyElementDescriptors(TestPmo.DUAL_PMO_PROPERTY); EnabledAspectDefinition enabledAspectDefinition = new EnabledAspectDefinition(EnabledType.ENABLED); descriptors.addDescriptor(TestUIAnnotation.class, new ElementDescriptor(0, TestLinkkiComponentDefinition.create(), BoundProperty.of(TestPmo.DUAL_PMO_PROPERTY), Collections.singletonList(enabledAspectDefinition)), TestPmo.class); VisibleAspectDefinition visibleAspectDefinition = new VisibleAspectDefinition(VisibleType.VISIBLE); descriptors.addDescriptor(AnotherTestUIAnnotation.class, new ElementDescriptor(0, TestLinkkiComponentDefinition.create(), BoundProperty.of(TestPmo.DUAL_PMO_PROPERTY), Collections.singletonList(visibleAspectDefinition)), TestPmo.class); TestComponentClickAspectDefinition clickAspectDefinition = new TestComponentClickAspectDefinition(); descriptors.addAspect(Arrays.<LinkkiAspectDefinition> asList(clickAspectDefinition)); assertThat(descriptors.getAllAspects(), containsInAnyOrder(enabledAspectDefinition, visibleAspectDefinition, clickAspectDefinition)); }
public List<LinkkiAspectDefinition> getAllAspects() { return Stream.concat( descriptors.values().stream() .map(d -> d.getAspectDefinitions()) .flatMap(Collection::stream), additionalAspects.stream()) .collect(toList()); }
PropertyElementDescriptors { public List<LinkkiAspectDefinition> getAllAspects() { return Stream.concat( descriptors.values().stream() .map(d -> d.getAspectDefinitions()) .flatMap(Collection::stream), additionalAspects.stream()) .collect(toList()); } }
PropertyElementDescriptors { public List<LinkkiAspectDefinition> getAllAspects() { return Stream.concat( descriptors.values().stream() .map(d -> d.getAspectDefinitions()) .flatMap(Collection::stream), additionalAspects.stream()) .collect(toList()); } PropertyElementDescriptors(String pmoPropertyName); }
PropertyElementDescriptors { public List<LinkkiAspectDefinition> getAllAspects() { return Stream.concat( descriptors.values().stream() .map(d -> d.getAspectDefinitions()) .flatMap(Collection::stream), additionalAspects.stream()) .collect(toList()); } PropertyElementDescriptors(String pmoPropertyName); int getPosition(); String getPmoPropertyName(); ElementDescriptor getDescriptor(Object pmo); void addAspect(List<LinkkiAspectDefinition> aspectDefs); boolean isNotEmpty(); List<LinkkiAspectDefinition> getAllAspects(); }
PropertyElementDescriptors { public List<LinkkiAspectDefinition> getAllAspects() { return Stream.concat( descriptors.values().stream() .map(d -> d.getAspectDefinitions()) .flatMap(Collection::stream), additionalAspects.stream()) .collect(toList()); } PropertyElementDescriptors(String pmoPropertyName); int getPosition(); String getPmoPropertyName(); ElementDescriptor getDescriptor(Object pmo); void addAspect(List<LinkkiAspectDefinition> aspectDefs); boolean isNotEmpty(); List<LinkkiAspectDefinition> getAllAspects();  }