1
0
Fork 0

added mappings for basic types

This commit is contained in:
Claudio Atzori 2019-10-24 17:21:45 +02:00
parent 52abfcfac7
commit 5f339a2c24
1 changed files with 18 additions and 0 deletions

View File

@ -45,4 +45,22 @@ public class ProtoUtils {
.setDataInfo(sp.hasDataInfo() ? mapDataInfo(sp.getDataInfo()) : null); .setDataInfo(sp.hasDataInfo() ? mapDataInfo(sp.getDataInfo()) : null);
} }
public static Field<String> mapStringField(FieldTypeProtos.StringField s) {
return new Field<String>()
.setValue(s.getValue())
.setDataInfo(s.hasDataInfo() ? mapDataInfo(s.getDataInfo()) : null);
}
public static Field<Boolean> mapBoolField(FieldTypeProtos.BoolField b) {
return new Field<Boolean>()
.setValue(b.getValue())
.setDataInfo(b.hasDataInfo() ? mapDataInfo(b.getDataInfo()) : null);
}
public static Field<Integer> mapIntField(FieldTypeProtos.IntField b) {
return new Field<Integer>()
.setValue(b.getValue())
.setDataInfo(b.hasDataInfo() ? mapDataInfo(b.getDataInfo()) : null);
}
} }