@Test public void register() { SingleProperty<Object> singleProperty = new SingleProperty<Object>("", "", "property1", "defaultValue", false, false) { @Override public Object getDefaultValue() { return null; } @Override protected void setDefaultValue(Object defaultValue) { } @Override protected Object getUsedValue() { return "myValue"; } @Override protected void setUsedValue(Object usedValue) { } @Override public AbstractPropertyUpdate<Object> createPropertyUpdate(Object updateValue) { return null; } @Override public Object parseLiteral(String literal) { return null; } }; Properties properties = new Properties(); singleProperty.register(properties); assertThat(properties.getProperty("property1"), is(equalTo("myValue"))); }
@Override public void register(Properties properties) { properties.setProperty(logicalName, getValue().toString()); }
SingleProperty extends AbstractProperty { @Override public void register(Properties properties) { properties.setProperty(logicalName, getValue().toString()); } }
SingleProperty extends AbstractProperty { @Override public void register(Properties properties) { properties.setProperty(logicalName, getValue().toString()); } SingleProperty();  SingleProperty(String name, String description, String logicalName, T defaultValue, boolean advanced, boolean serverRestartRequired); }
SingleProperty extends AbstractProperty { @Override public void register(Properties properties) { properties.setProperty(logicalName, getValue().toString()); } SingleProperty();  SingleProperty(String name, String description, String logicalName, T defaultValue, boolean advanced, boolean serverRestartRequired); abstract T getDefaultValue(); abstract T parseLiteral(String literal); @Override boolean isAdvanced(); boolean isPassword(); @Override boolean isServerRestartRequired(); @Override void register(Properties properties); @Override SingleProperty<?> forLogicalname(String propertyLogicalName); void setToDefaultValue(); AbstractPropertyUpdate<T> createAndValidatePropertyUpdate(T updateValue); RestoreDefaultPropertyUpdate<T> createRestoreDefaultPropertyUpdate(); @SuppressWarnings("unchecked") boolean canUpdate(IPropertyUpdate<?> propertyUpdate); void addValidator(ISinglePropertyValidator<? super T> validator); boolean isDefaultValueUsed(); T getValue(); void setValue(T value); String getLogicalName(); String getFormattedValue(); @Override int hashCode(); @Override boolean equals(Object obj); }
SingleProperty extends AbstractProperty { @Override public void register(Properties properties) { properties.setProperty(logicalName, getValue().toString()); } SingleProperty();  SingleProperty(String name, String description, String logicalName, T defaultValue, boolean advanced, boolean serverRestartRequired); abstract T getDefaultValue(); abstract T parseLiteral(String literal); @Override boolean isAdvanced(); boolean isPassword(); @Override boolean isServerRestartRequired(); @Override void register(Properties properties); @Override SingleProperty<?> forLogicalname(String propertyLogicalName); void setToDefaultValue(); AbstractPropertyUpdate<T> createAndValidatePropertyUpdate(T updateValue); RestoreDefaultPropertyUpdate<T> createRestoreDefaultPropertyUpdate(); @SuppressWarnings("unchecked") boolean canUpdate(IPropertyUpdate<?> propertyUpdate); void addValidator(ISinglePropertyValidator<? super T> validator); boolean isDefaultValueUsed(); T getValue(); void setValue(T value); String getLogicalName(); String getFormattedValue(); @Override int hashCode(); @Override boolean equals(Object obj);  }