forked from External/mage
[ONC] Implement Synthesis Pod
This commit is contained in:
parent
aba51aadfd
commit
b979f47cc3
3 changed files with 170 additions and 0 deletions
|
|
@ -1705,6 +1705,10 @@ public final class CardUtil {
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
public static <T> Stream<T> castStream(Collection<?> collection, Class<T> clazz) {
|
||||
return castStream(collection.stream(), clazz);
|
||||
}
|
||||
|
||||
public static <T> Stream<T> castStream(Stream<?> stream, Class<T> clazz) {
|
||||
return stream.filter(clazz::isInstance).map(clazz::cast).filter(Objects::nonNull);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue