-
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.
IPROTO-343 Allow null values for primitive types with PROTO3 syntax
- Loading branch information
1 parent
77ab992
commit 56015c1
Showing
11 changed files
with
174 additions
and
10 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
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
39 changes: 39 additions & 0 deletions
39
.../org/infinispan/protostream/integrationtests/processor/marshaller/model/NoNullsModel.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,39 @@ | ||
package org.infinispan.protostream.integrationtests.processor.marshaller.model; | ||
|
||
import org.infinispan.protostream.GeneratedSchema; | ||
import org.infinispan.protostream.annotations.ProtoFactory; | ||
import org.infinispan.protostream.annotations.ProtoField; | ||
import org.infinispan.protostream.annotations.ProtoSchema; | ||
import org.infinispan.protostream.annotations.ProtoSyntax; | ||
|
||
|
||
public class NoNullsModel { | ||
|
||
public static final GeneratedSchema SCHEMA = new NoNullsSchemaImpl(); | ||
|
||
@ProtoField(1) | ||
public String string; | ||
|
||
@ProtoField(2) | ||
public Integer boxedInt; | ||
|
||
@ProtoField(3) | ||
public int primitiveInt; | ||
|
||
@ProtoFactory | ||
public NoNullsModel(String string, Integer boxedInt, int primitiveInt) { | ||
this.string = string; | ||
this.boxedInt = boxedInt; | ||
this.primitiveInt = primitiveInt; | ||
} | ||
|
||
@ProtoSchema( | ||
includeClasses = NoNullsModel.class, | ||
schemaPackageName = "nonulls", | ||
schemaFilePath = "proto", | ||
schemaFileName = "nonulls.proto", | ||
syntax = ProtoSyntax.PROTO3 | ||
) | ||
interface NoNullsSchema extends GeneratedSchema { | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...infinispan/protostream/integrationtests/processor/marshaller/model/NullsAllowedModel.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,40 @@ | ||
package org.infinispan.protostream.integrationtests.processor.marshaller.model; | ||
|
||
import org.infinispan.protostream.GeneratedSchema; | ||
import org.infinispan.protostream.annotations.ProtoFactory; | ||
import org.infinispan.protostream.annotations.ProtoField; | ||
import org.infinispan.protostream.annotations.ProtoSchema; | ||
import org.infinispan.protostream.annotations.ProtoSyntax; | ||
|
||
|
||
public class NullsAllowedModel { | ||
|
||
public static final GeneratedSchema SCHEMA = new NullsAllowedSchemaImpl(); | ||
|
||
@ProtoField(1) | ||
public String string; | ||
|
||
@ProtoField(2) | ||
public Integer boxedInt; | ||
|
||
@ProtoField(value = 3, defaultValue = "0") | ||
public int primitiveInt; | ||
|
||
@ProtoFactory | ||
public NullsAllowedModel(String string, Integer boxedInt, int primitiveInt) { | ||
this.string = string; | ||
this.boxedInt = boxedInt; | ||
this.primitiveInt = primitiveInt; | ||
} | ||
|
||
@ProtoSchema( | ||
allowNullFields = true, | ||
includeClasses = NullsAllowedModel.class, | ||
schemaPackageName = "allownulls", | ||
schemaFilePath = "proto", | ||
schemaFileName = "allownulls.proto", | ||
syntax = ProtoSyntax.PROTO3 | ||
) | ||
interface NullsAllowedSchema extends GeneratedSchema { | ||
} | ||
} |
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