diff --git a/src/org/redkale/util/Sheet.java b/src/org/redkale/util/Sheet.java index 76f38ab52..85676afdf 100644 --- a/src/org/redkale/util/Sheet.java +++ b/src/org/redkale/util/Sheet.java @@ -67,7 +67,7 @@ public class Sheet implements java.io.Serializable, Iterable { @Override public String toString() { - return "Sheet[total=" + this.total + ", rows=" + this.rows + "]"; + return "{\"total\":" + this.total + ", \"rows\":" + this.rows + "}"; } public long getTotal() { @@ -107,6 +107,12 @@ public class Sheet implements java.io.Serializable, Iterable { } } + public void forEachParallel(final Consumer consumer) { + if (consumer != null && this.rows != null && !this.rows.isEmpty()) { + this.rows.parallelStream().forEach(consumer); + } + } + @Override public Spliterator spliterator() { return (this.rows == null) ? new ArrayList().spliterator() : this.rows.spliterator();