Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
Use SerializableFunction, add serializable test (#210)
Browse files Browse the repository at this point in the history
* Make classes serializable, add test
  • Loading branch information
Ilia Motornyi authored and pekam committed May 24, 2018
1 parent 32c07ea commit e10c3e7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
<scope>provided</scope>
</dependency>

<!-- Dependencies for the test -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>flow-test-generic</artifactId>
<version>${flow.version}</version>
<scope>test</scope>
</dependency>
<!-- Dependencies for the demo -->
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/vaadin/flow/component/grid/AbstractRow.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.vaadin.flow.component.grid.AbstractRow.AbstractCell;
import com.vaadin.flow.component.grid.Grid.Column;
import com.vaadin.flow.dom.Element;
import com.vaadin.flow.function.SerializableFunction;

/**
* Base class for header and footer rows
Expand Down Expand Up @@ -90,9 +91,9 @@ protected AbstractColumn<?> getColumn() {
protected ColumnLayer layer;
protected List<CELL> cells;

private Function<AbstractColumn<?>, CELL> cellCtor;
private SerializableFunction<AbstractColumn<?>, CELL> cellCtor;

AbstractRow(ColumnLayer layer, Function<AbstractColumn<?>, CELL> cellCtor) {
AbstractRow(ColumnLayer layer, SerializableFunction<AbstractColumn<?>, CELL> cellCtor) {
this.layer = layer;
this.cellCtor = cellCtor;
cells = layer.getColumns().stream().map(cellCtor)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.vaadin.flow.component.grid;

import java.util.stream.Stream;

import com.vaadin.flow.testutil.ClassesSerializableTest;

public class GridSerializableTest extends ClassesSerializableTest {
@Override
protected Stream<String> getExcludedPatterns() {
return Stream.concat(super.getExcludedPatterns(),Stream.of(
"com\\.vaadin\\.flow\\.component\\.grid\\.it\\..*"
));
}
}

0 comments on commit e10c3e7

Please sign in to comment.