[New] Added ListParameter.addAllValuesIfNotContains()
This commit is contained in:
parent
34d53d5d56
commit
c6b7a957a6
|
@ -112,6 +112,15 @@ public class FloatListParameter extends AbstractParameter<List<Double>> implemen
|
|||
this.value.addAll(values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAllValuesIfNotContains(List<Double> values) {
|
||||
assertNotReadonly();
|
||||
for (Double value : values) {
|
||||
if (!this.value.contains(value))
|
||||
this.value.add(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addValueIfNotContains(Double value) {
|
||||
assertNotReadonly();
|
||||
|
|
|
@ -112,6 +112,15 @@ public class IntegerListParameter extends AbstractParameter<List<Integer>> imple
|
|||
this.value.addAll(values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAllValuesIfNotContains(List<Integer> values) {
|
||||
assertNotReadonly();
|
||||
for (Integer value : values) {
|
||||
if (!this.value.contains(value))
|
||||
this.value.add(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addValueIfNotContains(Integer value) {
|
||||
assertNotReadonly();
|
||||
|
|
|
@ -43,6 +43,14 @@ public interface ListParameter<E> extends Parameter<List<E>> {
|
|||
*/
|
||||
void addAllValues(List<E> values);
|
||||
|
||||
/**
|
||||
* Adds all of the given values to the {@link List} of values which are not already in the current list
|
||||
*
|
||||
* @param values
|
||||
* the values to add
|
||||
*/
|
||||
void addAllValuesIfNotContains(List<E> values);
|
||||
|
||||
/**
|
||||
* Adds a single value to the {@link List} of values if the current list does not already contain the value
|
||||
*
|
||||
|
|
|
@ -112,6 +112,15 @@ public class LongListParameter extends AbstractParameter<List<Long>> implements
|
|||
this.value.addAll(values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAllValuesIfNotContains(List<Long> values) {
|
||||
assertNotReadonly();
|
||||
for (Long value : values) {
|
||||
if (!this.value.contains(value))
|
||||
this.value.add(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addValueIfNotContains(Long value) {
|
||||
assertNotReadonly();
|
||||
|
|
|
@ -112,6 +112,15 @@ public class StringListParameter extends AbstractParameter<List<String>> impleme
|
|||
this.value.addAll(values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAllValuesIfNotContains(List<String> values) {
|
||||
assertNotReadonly();
|
||||
for (String value : values) {
|
||||
if (!this.value.contains(value))
|
||||
this.value.add(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addValueIfNotContains(String value) {
|
||||
assertNotReadonly();
|
||||
|
|
Loading…
Reference in New Issue