예제 #1
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, MentionEntity struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(struct.id);
      oprot.writeFieldEnd();
      if (struct.name != null) {
        if (struct.isSetName()) {
          oprot.writeFieldBegin(NAME_FIELD_DESC);
          oprot.writeString(struct.name);
          oprot.writeFieldEnd();
        }
      }
      if (struct.screen_name != null) {
        if (struct.isSetScreen_name()) {
          oprot.writeFieldBegin(SCREEN_NAME_FIELD_DESC);
          oprot.writeString(struct.screen_name);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
예제 #2
0
  public boolean equals(MentionEntity that) {
    if (that == null) return false;

    boolean this_present_id = true;
    boolean that_present_id = true;
    if (this_present_id || that_present_id) {
      if (!(this_present_id && that_present_id)) return false;
      if (this.id != that.id) return false;
    }

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name)) return false;
      if (!this.name.equals(that.name)) return false;
    }

    boolean this_present_screen_name = true && this.isSetScreen_name();
    boolean that_present_screen_name = true && that.isSetScreen_name();
    if (this_present_screen_name || that_present_screen_name) {
      if (!(this_present_screen_name && that_present_screen_name)) return false;
      if (!this.screen_name.equals(that.screen_name)) return false;
    }

    return true;
  }
예제 #3
0
 /** Performs a deep copy on <i>other</i>. */
 public MentionEntity(MentionEntity other) {
   __isset_bitfield = other.__isset_bitfield;
   this.id = other.id;
   if (other.isSetName()) {
     this.name = other.name;
   }
   if (other.isSetScreen_name()) {
     this.screen_name = other.screen_name;
   }
 }
예제 #4
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, MentionEntity struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetId()) {
     optionals.set(0);
   }
   if (struct.isSetName()) {
     optionals.set(1);
   }
   if (struct.isSetScreen_name()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetId()) {
     oprot.writeI64(struct.id);
   }
   if (struct.isSetName()) {
     oprot.writeString(struct.name);
   }
   if (struct.isSetScreen_name()) {
     oprot.writeString(struct.screen_name);
   }
 }
예제 #5
0
  @Override
  public int compareTo(MentionEntity other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetScreen_name()).compareTo(other.isSetScreen_name());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScreen_name()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.screen_name, other.screen_name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
예제 #6
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, MentionEntity struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.id = iprot.readI64();
              struct.setIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SCREEN_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.screen_name = iprot.readString();
              struct.setScreen_nameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }
예제 #7
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, MentionEntity struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     struct.id = iprot.readI64();
     struct.setIdIsSet(true);
   }
   if (incoming.get(1)) {
     struct.name = iprot.readString();
     struct.setNameIsSet(true);
   }
   if (incoming.get(2)) {
     struct.screen_name = iprot.readString();
     struct.setScreen_nameIsSet(true);
   }
 }