diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-11-01 10:36:47 +0100 |
---|---|---|
committer | Pekka Maanpää <pekkamaa@vaadin.com> | 2017-11-01 11:36:47 +0200 |
commit | 3763f3f94cbcb0b5035ba547accf123b5c50ed3d (patch) | |
tree | 762058cc800575af022601d39fcdd3326a6dd078 /testbench-api | |
parent | 04905e1e2eb81770d813abda6a516254e541443d (diff) | |
download | vaadin-framework-3763f3f94cbcb0b5035ba547accf123b5c50ed3d.tar.gz vaadin-framework-3763f3f94cbcb0b5035ba547accf123b5c50ed3d.zip |
Use lambda expressions. (#10268)
Diffstat (limited to 'testbench-api')
-rw-r--r-- | testbench-api/src/main/java/com/vaadin/testbench/elements/GridElement.java | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/testbench-api/src/main/java/com/vaadin/testbench/elements/GridElement.java b/testbench-api/src/main/java/com/vaadin/testbench/elements/GridElement.java index a7253b7229..79b84780ac 100644 --- a/testbench-api/src/main/java/com/vaadin/testbench/elements/GridElement.java +++ b/testbench-api/src/main/java/com/vaadin/testbench/elements/GridElement.java @@ -496,35 +496,29 @@ public class GridElement extends AbstractComponentElement { * @return an iterable of all the data rows in the grid. */ public Iterable<GridRowElement> getRows() { - return new Iterable<GridElement.GridRowElement>() { + return () -> new Iterator<GridElement.GridRowElement>() { + int nextIndex = 0; + + @Override + public GridRowElement next() { + return getRow(nextIndex++); + } + @Override - public Iterator<GridRowElement> iterator() { - return new Iterator<GridElement.GridRowElement>() { - int nextIndex = 0; - - @Override - public GridRowElement next() { - return getRow(nextIndex++); - } - - @Override - public boolean hasNext() { - try { - getRow(nextIndex); - return true; - } catch (Exception e) { - return false; - } - } - - @Override - public void remove() { - throw new UnsupportedOperationException( - "remove not supported"); - } - - }; + public boolean hasNext() { + try { + getRow(nextIndex); + return true; + } catch (Exception e) { + return false; + } } + + @Override + public void remove() { + throw new UnsupportedOperationException("remove not supported"); + } + }; } } |