@Test public void testCreateAspect_static() { TooltipAspectDefinition aspectDefinition = new TooltipAspectDefinition(TooltipType.STATIC, "Foo"); Aspect<String> createdAspect = aspectDefinition.createAspect(); assertThat(createdAspect.getName(), is(TooltipAspectDefinition.NAME)); assertThat(createdAspect.getValue(), is("Foo")); }
@Override public Aspect<String> createAspect() { switch (type) { case AUTO: return StringUtils.isEmpty(value) ? Aspect.of(NAME) : Aspect.of(NAME, value); case STATIC: return Aspect.of(NAME, value); case DYNAMIC: return Aspect.of(NAME); default: throw new IllegalArgumentException("TooltipType " + type + " is not supported."); } }
TooltipAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (type) { case AUTO: return StringUtils.isEmpty(value) ? Aspect.of(NAME) : Aspect.of(NAME, value); case STATIC: return Aspect.of(NAME, value); case DYNAMIC: return Aspect.of(NAME); default: throw new IllegalArgumentException("TooltipType " + type + " is not supported."); } } }
TooltipAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (type) { case AUTO: return StringUtils.isEmpty(value) ? Aspect.of(NAME) : Aspect.of(NAME, value); case STATIC: return Aspect.of(NAME, value); case DYNAMIC: return Aspect.of(NAME); default: throw new IllegalArgumentException("TooltipType " + type + " is not supported."); } } TooltipAspectDefinition(TooltipType type, String value); }
TooltipAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (type) { case AUTO: return StringUtils.isEmpty(value) ? Aspect.of(NAME) : Aspect.of(NAME, value); case STATIC: return Aspect.of(NAME, value); case DYNAMIC: return Aspect.of(NAME); default: throw new IllegalArgumentException("TooltipType " + type + " is not supported."); } } TooltipAspectDefinition(TooltipType type, String value); @Override Aspect<String> createAspect(); @Override Consumer<String> createComponentValueSetter(ComponentWrapper componentWrapper); }
TooltipAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (type) { case AUTO: return StringUtils.isEmpty(value) ? Aspect.of(NAME) : Aspect.of(NAME, value); case STATIC: return Aspect.of(NAME, value); case DYNAMIC: return Aspect.of(NAME); default: throw new IllegalArgumentException("TooltipType " + type + " is not supported."); } } TooltipAspectDefinition(TooltipType type, String value); @Override Aspect<String> createAspect(); @Override Consumer<String> createComponentValueSetter(ComponentWrapper componentWrapper); static final String NAME; }