diff --git a/li.strolch.model/src/main/java/li/strolch/model/parameter/AbstractListParameter.java b/li.strolch.model/src/main/java/li/strolch/model/parameter/AbstractListParameter.java index 8707bbca8..15bca4b6d 100644 --- a/li.strolch.model/src/main/java/li/strolch/model/parameter/AbstractListParameter.java +++ b/li.strolch.model/src/main/java/li/strolch/model/parameter/AbstractListParameter.java @@ -6,6 +6,7 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.stream.Stream; import li.strolch.exception.StrolchException; import li.strolch.utils.helper.StringHelper; @@ -90,6 +91,16 @@ public abstract class AbstractListParameter extends AbstractParameter return new ArrayList<>(this.value); } + @Override + public E getValue(int index) { + return this.value.get(index); + } + + @Override + public Stream streamValues() { + return this.value.stream(); + } + @Override public void setValue(List values) { assertNotReadonly(); diff --git a/li.strolch.model/src/main/java/li/strolch/model/parameter/ListParameter.java b/li.strolch.model/src/main/java/li/strolch/model/parameter/ListParameter.java index bcc82a1ae..62d2c025f 100644 --- a/li.strolch.model/src/main/java/li/strolch/model/parameter/ListParameter.java +++ b/li.strolch.model/src/main/java/li/strolch/model/parameter/ListParameter.java @@ -17,6 +17,7 @@ package li.strolch.model.parameter; import java.util.Collection; import java.util.List; +import java.util.stream.Stream; /** * A {@link Parameter} which supports a list of elements. @@ -28,6 +29,23 @@ public interface ListParameter extends Parameter> { String VALUE_SEPARATOR1 = ";"; //$NON-NLS-1$ String VALUE_SEPARATOR2 = ","; //$NON-NLS-1$ + /** + * Returns the value at the given index of this {@link ListParameter}'s value + * + * @param index + * the index from which to return the value + * + * @return the value at the given index + */ + E getValue(int index); + + /** + * Returns a {@link Stream} for the values of this list + * + * @return a stream for the values + */ + Stream streamValues(); + /** * Set the internal value to have the content of the collection *