-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#394] Don't use generics when marshalling collections
* A temporary workaround for the issue. Full support for generic parameter types will need to be added to type mirroring
- Loading branch information
1 parent
7476705
commit 67873a1
Showing
8 changed files
with
101 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
core/src/test/java/org/infinispan/protostream/domain/Pair.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.infinispan.protostream.domain; | ||
|
||
public class Pair<L, R> { | ||
private final L l; | ||
private final R r; | ||
|
||
public Pair(L l, R r) { | ||
this.l = l; | ||
this.r = r; | ||
} | ||
|
||
public L left() { | ||
return l; | ||
} | ||
|
||
public R right() { | ||
return r; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
core/src/test/java/org/infinispan/protostream/domain/PairAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.infinispan.protostream.domain; | ||
|
||
import org.infinispan.protostream.WrappedMessage; | ||
import org.infinispan.protostream.annotations.ProtoAdapter; | ||
import org.infinispan.protostream.annotations.ProtoFactory; | ||
import org.infinispan.protostream.annotations.ProtoField; | ||
|
||
@ProtoAdapter(Pair.class) | ||
public class PairAdapter { | ||
|
||
@ProtoFactory | ||
public Pair<?, ?> create(WrappedMessage left, WrappedMessage right) { | ||
return new Pair<>(left.getValue(), right.getValue()); | ||
} | ||
|
||
@ProtoField(number = 1) | ||
public WrappedMessage getLeft(Pair<?, ?> pair) { | ||
return new WrappedMessage(pair.left()); | ||
} | ||
|
||
@ProtoField(number = 2) | ||
public WrappedMessage getRight(Pair<?, ?> pair) { | ||
return new WrappedMessage(pair.right()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters