Exemple #1
0
 /** Performs a deep copy on <i>other</i>. */
 public TArticle(TArticle other) {
   __isset_bit_vector.clear();
   __isset_bit_vector.or(other.__isset_bit_vector);
   if (other.isSetTitle()) {
     this.title = other.title;
   }
   if (other.isSetContent()) {
     this.content = other.content;
   }
   if (other.isSetSummary()) {
     this.summary = other.summary;
   }
   this.publishTime = other.publishTime;
   if (other.isSetOriginalUrl()) {
     this.originalUrl = other.originalUrl;
   }
   if (other.isSetArticleFrom()) {
     this.articleFrom = other.articleFrom;
   }
   this.articleType = other.articleType;
   this.topDay = other.topDay;
   if (other.isSetImageItems()) {
     List<TImageItem> __this__imageItems = new ArrayList<TImageItem>();
     for (TImageItem other_element : other.imageItems) {
       __this__imageItems.add(new TImageItem(other_element));
     }
     this.imageItems = __this__imageItems;
   }
   if (other.isSetArticleUuid()) {
     this.articleUuid = other.articleUuid;
   }
 }
Exemple #2
0
  public int compareTo(TArticle other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    TArticle typedOther = (TArticle) other;

    lastComparison = Boolean.valueOf(isSetTitle()).compareTo(typedOther.isSetTitle());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTitle()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.title, typedOther.title);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetContent()).compareTo(typedOther.isSetContent());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetContent()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.content, typedOther.content);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSummary()).compareTo(typedOther.isSetSummary());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSummary()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.summary, typedOther.summary);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPublishTime()).compareTo(typedOther.isSetPublishTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPublishTime()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.publishTime, typedOther.publishTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOriginalUrl()).compareTo(typedOther.isSetOriginalUrl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOriginalUrl()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.originalUrl, typedOther.originalUrl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetArticleFrom()).compareTo(typedOther.isSetArticleFrom());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetArticleFrom()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.articleFrom, typedOther.articleFrom);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetArticleType()).compareTo(typedOther.isSetArticleType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetArticleType()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.articleType, typedOther.articleType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTopDay()).compareTo(typedOther.isSetTopDay());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTopDay()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.topDay, typedOther.topDay);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetImageItems()).compareTo(typedOther.isSetImageItems());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetImageItems()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.imageItems, typedOther.imageItems);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetArticleUuid()).compareTo(typedOther.isSetArticleUuid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetArticleUuid()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.articleUuid, typedOther.articleUuid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Exemple #3
0
  public boolean equals(TArticle that) {
    if (that == null) return false;

    boolean this_present_title = true && this.isSetTitle();
    boolean that_present_title = true && that.isSetTitle();
    if (this_present_title || that_present_title) {
      if (!(this_present_title && that_present_title)) return false;
      if (!this.title.equals(that.title)) return false;
    }

    boolean this_present_content = true && this.isSetContent();
    boolean that_present_content = true && that.isSetContent();
    if (this_present_content || that_present_content) {
      if (!(this_present_content && that_present_content)) return false;
      if (!this.content.equals(that.content)) return false;
    }

    boolean this_present_summary = true && this.isSetSummary();
    boolean that_present_summary = true && that.isSetSummary();
    if (this_present_summary || that_present_summary) {
      if (!(this_present_summary && that_present_summary)) return false;
      if (!this.summary.equals(that.summary)) return false;
    }

    boolean this_present_publishTime = true;
    boolean that_present_publishTime = true;
    if (this_present_publishTime || that_present_publishTime) {
      if (!(this_present_publishTime && that_present_publishTime)) return false;
      if (this.publishTime != that.publishTime) return false;
    }

    boolean this_present_originalUrl = true && this.isSetOriginalUrl();
    boolean that_present_originalUrl = true && that.isSetOriginalUrl();
    if (this_present_originalUrl || that_present_originalUrl) {
      if (!(this_present_originalUrl && that_present_originalUrl)) return false;
      if (!this.originalUrl.equals(that.originalUrl)) return false;
    }

    boolean this_present_articleFrom = true && this.isSetArticleFrom();
    boolean that_present_articleFrom = true && that.isSetArticleFrom();
    if (this_present_articleFrom || that_present_articleFrom) {
      if (!(this_present_articleFrom && that_present_articleFrom)) return false;
      if (!this.articleFrom.equals(that.articleFrom)) return false;
    }

    boolean this_present_articleType = true;
    boolean that_present_articleType = true;
    if (this_present_articleType || that_present_articleType) {
      if (!(this_present_articleType && that_present_articleType)) return false;
      if (this.articleType != that.articleType) return false;
    }

    boolean this_present_topDay = true;
    boolean that_present_topDay = true;
    if (this_present_topDay || that_present_topDay) {
      if (!(this_present_topDay && that_present_topDay)) return false;
      if (this.topDay != that.topDay) return false;
    }

    boolean this_present_imageItems = true && this.isSetImageItems();
    boolean that_present_imageItems = true && that.isSetImageItems();
    if (this_present_imageItems || that_present_imageItems) {
      if (!(this_present_imageItems && that_present_imageItems)) return false;
      if (!this.imageItems.equals(that.imageItems)) return false;
    }

    boolean this_present_articleUuid = true && this.isSetArticleUuid();
    boolean that_present_articleUuid = true && that.isSetArticleUuid();
    if (this_present_articleUuid || that_present_articleUuid) {
      if (!(this_present_articleUuid && that_present_articleUuid)) return false;
      if (!this.articleUuid.equals(that.articleUuid)) return false;
    }

    return true;
  }