@Test public void testCreateUiUpdater() { CompositeAspectDefinition composite = new CompositeAspectDefinition(aspect1, aspect2NotSupported, aspect3); composite.createUiUpdater(propertyDispatcher, componentWrapper); verify(aspect1).supports(WrapperType.FIELD); verify(aspect2NotSupported).supports(WrapperType.FIELD); verify(aspect3).supports(WrapperType.FIELD); verify(aspect1).createUiUpdater(propertyDispatcher, componentWrapper); verify(aspect2NotSupported, never()).createUiUpdater(propertyDispatcher, componentWrapper); verify(aspect3).createUiUpdater(propertyDispatcher, componentWrapper); }
@Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { return aspectDefinitions.stream() .filter(d -> d.supports(componentWrapper.getType())) .map(lad -> lad.createUiUpdater(propertyDispatcher, componentWrapper)) .reduce(Handler.NOP_HANDLER, Handler::andThen); }
CompositeAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { return aspectDefinitions.stream() .filter(d -> d.supports(componentWrapper.getType())) .map(lad -> lad.createUiUpdater(propertyDispatcher, componentWrapper)) .reduce(Handler.NOP_HANDLER, Handler::andThen); } }
CompositeAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { return aspectDefinitions.stream() .filter(d -> d.supports(componentWrapper.getType())) .map(lad -> lad.createUiUpdater(propertyDispatcher, componentWrapper)) .reduce(Handler.NOP_HANDLER, Handler::andThen); } CompositeAspectDefinition(@NonNull LinkkiAspectDefinition... aspectDefinitions);  CompositeAspectDefinition(List<LinkkiAspectDefinition> aspectDefinitions); }
CompositeAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { return aspectDefinitions.stream() .filter(d -> d.supports(componentWrapper.getType())) .map(lad -> lad.createUiUpdater(propertyDispatcher, componentWrapper)) .reduce(Handler.NOP_HANDLER, Handler::andThen); } CompositeAspectDefinition(@NonNull LinkkiAspectDefinition... aspectDefinitions);  CompositeAspectDefinition(List<LinkkiAspectDefinition> aspectDefinitions); @Override Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper); @Override void initModelUpdate(PropertyDispatcher propertyDispatcher,
            ComponentWrapper componentWrapper,
            Handler modelUpdated); @Override boolean supports(WrapperType type); }
CompositeAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { return aspectDefinitions.stream() .filter(d -> d.supports(componentWrapper.getType())) .map(lad -> lad.createUiUpdater(propertyDispatcher, componentWrapper)) .reduce(Handler.NOP_HANDLER, Handler::andThen); } CompositeAspectDefinition(@NonNull LinkkiAspectDefinition... aspectDefinitions);  CompositeAspectDefinition(List<LinkkiAspectDefinition> aspectDefinitions); @Override Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper); @Override void initModelUpdate(PropertyDispatcher propertyDispatcher,
            ComponentWrapper componentWrapper,
            Handler modelUpdated); @Override boolean supports(WrapperType type);  }