コード例 #1
0
 public void write(TProtocol _oprot) throws org.apache.thrift.TException {
   validate();
   _oprot.writeStructBegin(STRUCT);
   _oprot.writeFieldBegin(UrlField);
   String url_item = url;
   _oprot.writeString(url_item);
   _oprot.writeFieldEnd();
   if (title.isDefined()) {
     _oprot.writeFieldBegin(TitleField);
     String title_item = title.get();
     _oprot.writeString(title_item);
     _oprot.writeFieldEnd();
   }
   if (keywords.isDefined()) {
     _oprot.writeFieldBegin(KeywordsField);
     String keywords_item = keywords.get();
     _oprot.writeString(keywords_item);
     _oprot.writeFieldEnd();
   }
   _oprot.writeFieldBegin(TypesField);
   List<RecommendTypeParam> types_item = types;
   _oprot.writeListBegin(new TList(TType.STRUCT, types_item.size()));
   for (RecommendTypeParam _types_item_element : types_item) {
     _types_item_element.write(_oprot);
   }
   _oprot.writeListEnd();
   _oprot.writeFieldEnd();
   _oprot.writeFieldStop();
   _oprot.writeStructEnd();
 }
コード例 #2
0
 public RecommendParam build() {
   if (!_got_url)
     throw new IllegalStateException(
         "Required field 'url' was not found for struct RecommendParam");
   if (!_got_types)
     throw new IllegalStateException(
         "Required field 'types' was not found for struct RecommendParam");
   return new RecommendParam(
       this._url,
       Option.make(this._got_title, this._title),
       Option.make(this._got_keywords, this._keywords),
       this._types);
 }