[New] Added new helper methods to Parameters

This commit is contained in:
Robert von Burg 2018-09-25 08:51:34 +02:00
parent 185e7950e4
commit 6fb3099232
13 changed files with 23 additions and 23 deletions

View File

@ -70,7 +70,7 @@ public class BooleanParameter extends AbstractParameter<Boolean> {
}
@Override
public void setValue(Parameter<Boolean> parameter) {
public void setValueFrom(Parameter<Boolean> parameter) {
assertNotReadonly();
this.value = parameter.getValue();
}

View File

@ -76,7 +76,7 @@ public class DateParameter extends AbstractParameter<Date> {
}
@Override
public void setValue(Parameter<Date> parameter) {
public void setValueFrom(Parameter<Date> parameter) {
assertNotReadonly();
this.value = parameter.getValue();
}

View File

@ -70,7 +70,7 @@ public class DurationParameter extends AbstractParameter<Long> {
}
@Override
public void setValue(Parameter<Long> parameter) {
public void setValueFrom(Parameter<Long> parameter) {
assertNotReadonly();
this.value = parameter.getValue();
}

View File

@ -92,7 +92,7 @@ public class FloatListParameter extends AbstractParameter<List<Double>> implemen
}
@Override
public void setValue(Parameter<List<Double>> parameter) {
public void setValueFrom(Parameter<List<Double>> parameter) {
assertNotReadonly();
this.value = new ArrayList<>(parameter.getValue());
}

View File

@ -71,7 +71,7 @@ public class FloatParameter extends AbstractParameter<Double> {
}
@Override
public void setValue(Parameter<Double> parameter) {
public void setValueFrom(Parameter<Double> parameter) {
assertNotReadonly();
this.value = parameter.getValue();
}

View File

@ -92,7 +92,7 @@ public class IntegerListParameter extends AbstractParameter<List<Integer>> imple
}
@Override
public void setValue(Parameter<List<Integer>> parameter) {
public void setValueFrom(Parameter<List<Integer>> parameter) {
assertNotReadonly();
this.value = new ArrayList<>(parameter.getValue());
}

View File

@ -79,7 +79,7 @@ public class IntegerParameter extends AbstractParameter<Integer> {
}
@Override
public void setValue(Parameter<Integer> parameter) {
public void setValueFrom(Parameter<Integer> parameter) {
assertNotReadonly();
this.value = parameter.getValue();
}

View File

@ -92,7 +92,7 @@ public class LongListParameter extends AbstractParameter<List<Long>> implements
}
@Override
public void setValue(Parameter<List<Long>> parameter) {
public void setValueFrom(Parameter<List<Long>> parameter) {
assertNotReadonly();
this.value = new ArrayList<>(parameter.getValue());
}

View File

@ -69,7 +69,7 @@ public class LongParameter extends AbstractParameter<Long> {
}
@Override
public void setValue(Parameter<Long> parameter) {
public void setValueFrom(Parameter<Long> parameter) {
assertNotReadonly();
this.value = parameter.getValue();
}

View File

@ -61,7 +61,7 @@ public interface Parameter<T> extends StrolchElement, Comparable<Parameter<?>> {
* @param parameter
* 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

View File

@ -92,7 +92,7 @@ public class StringListParameter extends AbstractParameter<List<String>> impleme
}
@Override
public void setValue(Parameter<List<String>> parameter) {
public void setValueFrom(Parameter<List<String>> parameter) {
assertNotReadonly();
this.value = new ArrayList<>(parameter.getValue());
}

View File

@ -79,7 +79,7 @@ public class StringParameter extends AbstractParameter<String> {
}
@Override
public void setValue(Parameter<String> parameter) {
public void setValueFrom(Parameter<String> parameter) {
assertNotReadonly();
this.value = parameter.getValue();
}

View File

@ -36,7 +36,7 @@ public class ParameterTest {
assertTrue(p.isEmpty());
assertEquals("", p.getValue());
p.setValue(other);
p.setValueFrom(other);
assertTrue(p.isEqualTo(other.getValue()));
assertTrue(p.isEqualTo(other));
}
@ -53,7 +53,7 @@ public class ParameterTest {
assertTrue(p.isEmpty());
assertEquals(Integer.valueOf(0), p.getValue());
p.setValue(other);
p.setValueFrom(other);
assertTrue(p.isEqualTo(other.getValue()));
assertTrue(p.isEqualTo(other));
@ -83,7 +83,7 @@ public class ParameterTest {
assertTrue(p.isEmpty());
assertEquals(Long.valueOf(0L), p.getValue());
p.setValue(other);
p.setValueFrom(other);
assertTrue(p.isEqualTo(other.getValue()));
assertTrue(p.isEqualTo(other));
@ -113,7 +113,7 @@ public class ParameterTest {
assertTrue(p.isEmpty());
assertEquals(Boolean.FALSE, p.getValue());
p.setValue(other);
p.setValueFrom(other);
assertTrue(p.isEqualTo(other.getValue()));
assertTrue(p.isEqualTo(other));
@ -133,7 +133,7 @@ public class ParameterTest {
assertTrue(p.isEmpty());
assertEquals(Double.valueOf(0.0D), p.getValue());
p.setValue(other);
p.setValueFrom(other);
assertTrue(p.isEqualTo(other.getValue()));
assertTrue(p.isEqualTo(other));
@ -163,7 +163,7 @@ public class ParameterTest {
assertTrue(p.isEmpty());
assertEquals(new Date(0L), p.getValue());
p.setValue(other);
p.setValueFrom(other);
assertTrue(p.isEqualTo(other.getValue()));
assertTrue(p.isEqualTo(other));
@ -193,7 +193,7 @@ public class ParameterTest {
assertTrue(p.isEmpty());
assertEquals(Long.valueOf(0L), p.getValue());
p.setValue(other);
p.setValueFrom(other);
assertTrue(p.isEqualTo(other.getValue()));
assertTrue(p.isEqualTo(other));
}
@ -210,7 +210,7 @@ public class ParameterTest {
assertTrue(p.isEmpty());
assertEquals(emptyList(), p.getValue());
p.setValue(other);
p.setValueFrom(other);
assertTrue(p.isEqualTo(other.getValue()));
assertTrue(p.isEqualTo(other));
@ -239,7 +239,7 @@ public class ParameterTest {
assertTrue(p.isEmpty());
assertEquals(emptyList(), p.getValue());
p.setValue(other);
p.setValueFrom(other);
assertTrue(p.isEqualTo(other.getValue()));
assertTrue(p.isEqualTo(other));
@ -268,7 +268,7 @@ public class ParameterTest {
assertTrue(p.isEmpty());
assertEquals(emptyList(), p.getValue());
p.setValue(other);
p.setValueFrom(other);
assertTrue(p.isEqualTo(other.getValue()));
assertTrue(p.isEqualTo(other));
@ -297,7 +297,7 @@ public class ParameterTest {
assertTrue(p.isEmpty());
assertEquals(emptyList(), p.getValue());
p.setValue(other);
p.setValueFrom(other);
assertTrue(p.isEqualTo(other.getValue()));
assertTrue(p.isEqualTo(other));