Skip to content

Commit

Permalink
ListTag stream convenience function
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 27, 2021
1 parent 751b5d1 commit 725472e
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.math.RoundingMode;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Stream;

public class ListTag implements List<String>, ObjectTag {

Expand Down Expand Up @@ -503,6 +504,11 @@ public ListTag(Set<?> items) {
}
}

public ListTag(Stream<String> items) {
objectForms = new ArrayList<>();
items.forEach(s -> objectForms.add(new ElementTag(s)));
}

/////////////
// Instance Fields/Methods
//////////
Expand Down

0 comments on commit 725472e

Please sign in to comment.