@Test public void testCreateAspect_visible() { VisibleAspectDefinition aspectDefinition = new VisibleAspectDefinition(VisibleType.VISIBLE); Aspect<Boolean> createdAspect = aspectDefinition.createAspect(); assertThat(createdAspect.getName(), is(VisibleAspectDefinition.NAME)); assertThat(createdAspect.getValue(), is(true)); }
@Override public Aspect<Boolean> createAspect() { switch (visibleType) { case DYNAMIC: return Aspect.of(NAME); case INVISIBLE: return Aspect.of(NAME, false); case VISIBLE: return Aspect.of(NAME, true); default: throw new IllegalStateException("Unknown visible type: " + visibleType); } }
VisibleAspectDefinition extends ModelToUiAspectDefinition<Boolean> { @Override public Aspect<Boolean> createAspect() { switch (visibleType) { case DYNAMIC: return Aspect.of(NAME); case INVISIBLE: return Aspect.of(NAME, false); case VISIBLE: return Aspect.of(NAME, true); default: throw new IllegalStateException("Unknown visible type: " + visibleType); } } }
VisibleAspectDefinition extends ModelToUiAspectDefinition<Boolean> { @Override public Aspect<Boolean> createAspect() { switch (visibleType) { case DYNAMIC: return Aspect.of(NAME); case INVISIBLE: return Aspect.of(NAME, false); case VISIBLE: return Aspect.of(NAME, true); default: throw new IllegalStateException("Unknown visible type: " + visibleType); } } VisibleAspectDefinition(VisibleType visibleType); }
VisibleAspectDefinition extends ModelToUiAspectDefinition<Boolean> { @Override public Aspect<Boolean> createAspect() { switch (visibleType) { case DYNAMIC: return Aspect.of(NAME); case INVISIBLE: return Aspect.of(NAME, false); case VISIBLE: return Aspect.of(NAME, true); default: throw new IllegalStateException("Unknown visible type: " + visibleType); } } VisibleAspectDefinition(VisibleType visibleType); @Override Aspect<Boolean> createAspect(); @Override Consumer<Boolean> createComponentValueSetter(ComponentWrapper componentWrapper); }
VisibleAspectDefinition extends ModelToUiAspectDefinition<Boolean> { @Override public Aspect<Boolean> createAspect() { switch (visibleType) { case DYNAMIC: return Aspect.of(NAME); case INVISIBLE: return Aspect.of(NAME, false); case VISIBLE: return Aspect.of(NAME, true); default: throw new IllegalStateException("Unknown visible type: " + visibleType); } } VisibleAspectDefinition(VisibleType visibleType); @Override Aspect<Boolean> createAspect(); @Override Consumer<Boolean> createComponentValueSetter(ComponentWrapper componentWrapper); static final String NAME; }