@Test public void testProperties() { final ModifierProperties modifierProperties = new ModifierProperties(); modifierProperties.put("minimum", Integer.MIN_VALUE); modifierProperties.put("maximum", Integer.MAX_VALUE); modifierProperties.put("minimumStep", 1); modifierProperties.put("maximumStep", 10); final Integer32Modifier modifier = new Integer32Modifier(); modifier.init(modifierProperties); assertEquals(modifier.getMinimum(), Integer.valueOf(Integer.MIN_VALUE)); assertEquals(modifier.getMaximum(), Integer.valueOf(Integer.MAX_VALUE)); assertEquals(modifier.getMinimumStep(), Integer.valueOf(1)); assertEquals(modifier.getMaximumStep(), Integer.valueOf(10)); }
@Override public void init(final ModifierProperties properties) { this.minimum = Optional.ofNullable(properties.getInteger("minimum")).orElse(Integer.MIN_VALUE); this.maximum = Optional.ofNullable(properties.getInteger("maximum")).orElse(Integer.MAX_VALUE); this.minimumStep = Optional.ofNullable(properties.getInteger("minimumStep")).orElse(-1); this.maximumStep = Optional.ofNullable(properties.getInteger("maximumStep")).orElse(1); }
Integer32Modifier implements VariableModifier<Integer32> { @Override public void init(final ModifierProperties properties) { this.minimum = Optional.ofNullable(properties.getInteger("minimum")).orElse(Integer.MIN_VALUE); this.maximum = Optional.ofNullable(properties.getInteger("maximum")).orElse(Integer.MAX_VALUE); this.minimumStep = Optional.ofNullable(properties.getInteger("minimumStep")).orElse(-1); this.maximumStep = Optional.ofNullable(properties.getInteger("maximumStep")).orElse(1); } }
Integer32Modifier implements VariableModifier<Integer32> { @Override public void init(final ModifierProperties properties) { this.minimum = Optional.ofNullable(properties.getInteger("minimum")).orElse(Integer.MIN_VALUE); this.maximum = Optional.ofNullable(properties.getInteger("maximum")).orElse(Integer.MAX_VALUE); this.minimumStep = Optional.ofNullable(properties.getInteger("minimumStep")).orElse(-1); this.maximumStep = Optional.ofNullable(properties.getInteger("maximumStep")).orElse(1); }  }
Integer32Modifier implements VariableModifier<Integer32> { @Override public void init(final ModifierProperties properties) { this.minimum = Optional.ofNullable(properties.getInteger("minimum")).orElse(Integer.MIN_VALUE); this.maximum = Optional.ofNullable(properties.getInteger("maximum")).orElse(Integer.MAX_VALUE); this.minimumStep = Optional.ofNullable(properties.getInteger("minimumStep")).orElse(-1); this.maximumStep = Optional.ofNullable(properties.getInteger("maximumStep")).orElse(1); }  @Override void init(final ModifierProperties properties); @Override Integer32 modify(final Integer32 variable); }
Integer32Modifier implements VariableModifier<Integer32> { @Override public void init(final ModifierProperties properties) { this.minimum = Optional.ofNullable(properties.getInteger("minimum")).orElse(Integer.MIN_VALUE); this.maximum = Optional.ofNullable(properties.getInteger("maximum")).orElse(Integer.MAX_VALUE); this.minimumStep = Optional.ofNullable(properties.getInteger("minimumStep")).orElse(-1); this.maximumStep = Optional.ofNullable(properties.getInteger("maximumStep")).orElse(1); }  @Override void init(final ModifierProperties properties); @Override Integer32 modify(final Integer32 variable);  }