コード例 #1
0
ファイル: DynamicMessage.java プロジェクト: Kinetic/kinetic-c
 /** Get a {@code DynamicMessage} representing the default instance of the given type. */
 public static DynamicMessage getDefaultInstance(Descriptor type) {
   int oneofDeclCount = type.toProto().getOneofDeclCount();
   FieldDescriptor[] oneofCases = new FieldDescriptor[oneofDeclCount];
   return new DynamicMessage(
       type,
       FieldSet.<FieldDescriptor>emptySet(),
       oneofCases,
       UnknownFieldSet.getDefaultInstance());
 }
コード例 #2
0
ファイル: DynamicMessage.java プロジェクト: Kinetic/kinetic-c
 /** Construct a {@code Builder} for the given type. */
 private Builder(Descriptor type) {
   this.type = type;
   this.fields = FieldSet.newFieldSet();
   this.unknownFields = UnknownFieldSet.getDefaultInstance();
   this.oneofCases = new FieldDescriptor[type.toProto().getOneofDeclCount()];
 }