code: private FieldDefinition declareTypeField()
      {
          FieldDefinition typeField = new FieldDefinition(a(PRIVATE, FINAL), "type", type(ThriftType.class));
          classDefinition.addField(typeField);
  
          // add constructor parameter to initialize this field
          parameters.add(typeField, ThriftType.struct(metadata));
  
          return typeField;
      }
docs: Declares the private ThriftType field type.