[New] Added new helper methods to Parameters
This commit is contained in:
parent
185e7950e4
commit
6fb3099232
|
@ -70,7 +70,7 @@ public class BooleanParameter extends AbstractParameter<Boolean> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Parameter<Boolean> parameter) {
|
public void setValueFrom(Parameter<Boolean> parameter) {
|
||||||
assertNotReadonly();
|
assertNotReadonly();
|
||||||
this.value = parameter.getValue();
|
this.value = parameter.getValue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class DateParameter extends AbstractParameter<Date> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Parameter<Date> parameter) {
|
public void setValueFrom(Parameter<Date> parameter) {
|
||||||
assertNotReadonly();
|
assertNotReadonly();
|
||||||
this.value = parameter.getValue();
|
this.value = parameter.getValue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class DurationParameter extends AbstractParameter<Long> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Parameter<Long> parameter) {
|
public void setValueFrom(Parameter<Long> parameter) {
|
||||||
assertNotReadonly();
|
assertNotReadonly();
|
||||||
this.value = parameter.getValue();
|
this.value = parameter.getValue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class FloatListParameter extends AbstractParameter<List<Double>> implemen
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Parameter<List<Double>> parameter) {
|
public void setValueFrom(Parameter<List<Double>> parameter) {
|
||||||
assertNotReadonly();
|
assertNotReadonly();
|
||||||
this.value = new ArrayList<>(parameter.getValue());
|
this.value = new ArrayList<>(parameter.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class FloatParameter extends AbstractParameter<Double> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Parameter<Double> parameter) {
|
public void setValueFrom(Parameter<Double> parameter) {
|
||||||
assertNotReadonly();
|
assertNotReadonly();
|
||||||
this.value = parameter.getValue();
|
this.value = parameter.getValue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class IntegerListParameter extends AbstractParameter<List<Integer>> imple
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Parameter<List<Integer>> parameter) {
|
public void setValueFrom(Parameter<List<Integer>> parameter) {
|
||||||
assertNotReadonly();
|
assertNotReadonly();
|
||||||
this.value = new ArrayList<>(parameter.getValue());
|
this.value = new ArrayList<>(parameter.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class IntegerParameter extends AbstractParameter<Integer> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Parameter<Integer> parameter) {
|
public void setValueFrom(Parameter<Integer> parameter) {
|
||||||
assertNotReadonly();
|
assertNotReadonly();
|
||||||
this.value = parameter.getValue();
|
this.value = parameter.getValue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class LongListParameter extends AbstractParameter<List<Long>> implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Parameter<List<Long>> parameter) {
|
public void setValueFrom(Parameter<List<Long>> parameter) {
|
||||||
assertNotReadonly();
|
assertNotReadonly();
|
||||||
this.value = new ArrayList<>(parameter.getValue());
|
this.value = new ArrayList<>(parameter.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class LongParameter extends AbstractParameter<Long> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Parameter<Long> parameter) {
|
public void setValueFrom(Parameter<Long> parameter) {
|
||||||
assertNotReadonly();
|
assertNotReadonly();
|
||||||
this.value = parameter.getValue();
|
this.value = parameter.getValue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public interface Parameter<T> extends StrolchElement, Comparable<Parameter<?>> {
|
||||||
* @param parameter
|
* @param parameter
|
||||||
* the parameter from which to copy the new value
|
* the parameter from which to copy the new value
|
||||||
*/
|
*/
|
||||||
public void setValue(Parameter<T> parameter);
|
public void setValueFrom(Parameter<T> parameter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears the value, dependent on the concrete class
|
* Clears the value, dependent on the concrete class
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class StringListParameter extends AbstractParameter<List<String>> impleme
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Parameter<List<String>> parameter) {
|
public void setValueFrom(Parameter<List<String>> parameter) {
|
||||||
assertNotReadonly();
|
assertNotReadonly();
|
||||||
this.value = new ArrayList<>(parameter.getValue());
|
this.value = new ArrayList<>(parameter.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class StringParameter extends AbstractParameter<String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(Parameter<String> parameter) {
|
public void setValueFrom(Parameter<String> parameter) {
|
||||||
assertNotReadonly();
|
assertNotReadonly();
|
||||||
this.value = parameter.getValue();
|
this.value = parameter.getValue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class ParameterTest {
|
||||||
assertTrue(p.isEmpty());
|
assertTrue(p.isEmpty());
|
||||||
assertEquals("", p.getValue());
|
assertEquals("", p.getValue());
|
||||||
|
|
||||||
p.setValue(other);
|
p.setValueFrom(other);
|
||||||
assertTrue(p.isEqualTo(other.getValue()));
|
assertTrue(p.isEqualTo(other.getValue()));
|
||||||
assertTrue(p.isEqualTo(other));
|
assertTrue(p.isEqualTo(other));
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public class ParameterTest {
|
||||||
assertTrue(p.isEmpty());
|
assertTrue(p.isEmpty());
|
||||||
assertEquals(Integer.valueOf(0), p.getValue());
|
assertEquals(Integer.valueOf(0), p.getValue());
|
||||||
|
|
||||||
p.setValue(other);
|
p.setValueFrom(other);
|
||||||
assertTrue(p.isEqualTo(other.getValue()));
|
assertTrue(p.isEqualTo(other.getValue()));
|
||||||
assertTrue(p.isEqualTo(other));
|
assertTrue(p.isEqualTo(other));
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public class ParameterTest {
|
||||||
assertTrue(p.isEmpty());
|
assertTrue(p.isEmpty());
|
||||||
assertEquals(Long.valueOf(0L), p.getValue());
|
assertEquals(Long.valueOf(0L), p.getValue());
|
||||||
|
|
||||||
p.setValue(other);
|
p.setValueFrom(other);
|
||||||
assertTrue(p.isEqualTo(other.getValue()));
|
assertTrue(p.isEqualTo(other.getValue()));
|
||||||
assertTrue(p.isEqualTo(other));
|
assertTrue(p.isEqualTo(other));
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ public class ParameterTest {
|
||||||
assertTrue(p.isEmpty());
|
assertTrue(p.isEmpty());
|
||||||
assertEquals(Boolean.FALSE, p.getValue());
|
assertEquals(Boolean.FALSE, p.getValue());
|
||||||
|
|
||||||
p.setValue(other);
|
p.setValueFrom(other);
|
||||||
assertTrue(p.isEqualTo(other.getValue()));
|
assertTrue(p.isEqualTo(other.getValue()));
|
||||||
assertTrue(p.isEqualTo(other));
|
assertTrue(p.isEqualTo(other));
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ public class ParameterTest {
|
||||||
assertTrue(p.isEmpty());
|
assertTrue(p.isEmpty());
|
||||||
assertEquals(Double.valueOf(0.0D), p.getValue());
|
assertEquals(Double.valueOf(0.0D), p.getValue());
|
||||||
|
|
||||||
p.setValue(other);
|
p.setValueFrom(other);
|
||||||
assertTrue(p.isEqualTo(other.getValue()));
|
assertTrue(p.isEqualTo(other.getValue()));
|
||||||
assertTrue(p.isEqualTo(other));
|
assertTrue(p.isEqualTo(other));
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ public class ParameterTest {
|
||||||
assertTrue(p.isEmpty());
|
assertTrue(p.isEmpty());
|
||||||
assertEquals(new Date(0L), p.getValue());
|
assertEquals(new Date(0L), p.getValue());
|
||||||
|
|
||||||
p.setValue(other);
|
p.setValueFrom(other);
|
||||||
assertTrue(p.isEqualTo(other.getValue()));
|
assertTrue(p.isEqualTo(other.getValue()));
|
||||||
assertTrue(p.isEqualTo(other));
|
assertTrue(p.isEqualTo(other));
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ public class ParameterTest {
|
||||||
assertTrue(p.isEmpty());
|
assertTrue(p.isEmpty());
|
||||||
assertEquals(Long.valueOf(0L), p.getValue());
|
assertEquals(Long.valueOf(0L), p.getValue());
|
||||||
|
|
||||||
p.setValue(other);
|
p.setValueFrom(other);
|
||||||
assertTrue(p.isEqualTo(other.getValue()));
|
assertTrue(p.isEqualTo(other.getValue()));
|
||||||
assertTrue(p.isEqualTo(other));
|
assertTrue(p.isEqualTo(other));
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ public class ParameterTest {
|
||||||
assertTrue(p.isEmpty());
|
assertTrue(p.isEmpty());
|
||||||
assertEquals(emptyList(), p.getValue());
|
assertEquals(emptyList(), p.getValue());
|
||||||
|
|
||||||
p.setValue(other);
|
p.setValueFrom(other);
|
||||||
assertTrue(p.isEqualTo(other.getValue()));
|
assertTrue(p.isEqualTo(other.getValue()));
|
||||||
assertTrue(p.isEqualTo(other));
|
assertTrue(p.isEqualTo(other));
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ public class ParameterTest {
|
||||||
assertTrue(p.isEmpty());
|
assertTrue(p.isEmpty());
|
||||||
assertEquals(emptyList(), p.getValue());
|
assertEquals(emptyList(), p.getValue());
|
||||||
|
|
||||||
p.setValue(other);
|
p.setValueFrom(other);
|
||||||
assertTrue(p.isEqualTo(other.getValue()));
|
assertTrue(p.isEqualTo(other.getValue()));
|
||||||
assertTrue(p.isEqualTo(other));
|
assertTrue(p.isEqualTo(other));
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ public class ParameterTest {
|
||||||
assertTrue(p.isEmpty());
|
assertTrue(p.isEmpty());
|
||||||
assertEquals(emptyList(), p.getValue());
|
assertEquals(emptyList(), p.getValue());
|
||||||
|
|
||||||
p.setValue(other);
|
p.setValueFrom(other);
|
||||||
assertTrue(p.isEqualTo(other.getValue()));
|
assertTrue(p.isEqualTo(other.getValue()));
|
||||||
assertTrue(p.isEqualTo(other));
|
assertTrue(p.isEqualTo(other));
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ public class ParameterTest {
|
||||||
assertTrue(p.isEmpty());
|
assertTrue(p.isEmpty());
|
||||||
assertEquals(emptyList(), p.getValue());
|
assertEquals(emptyList(), p.getValue());
|
||||||
|
|
||||||
p.setValue(other);
|
p.setValueFrom(other);
|
||||||
assertTrue(p.isEqualTo(other.getValue()));
|
assertTrue(p.isEqualTo(other.getValue()));
|
||||||
assertTrue(p.isEqualTo(other));
|
assertTrue(p.isEqualTo(other));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue