コード例 #1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, NotificationEventResponse struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   {
     org.apache.thrift.protocol.TList _list555 =
         new org.apache.thrift.protocol.TList(
             org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
     struct.events = new ArrayList<NotificationEvent>(_list555.size);
     NotificationEvent _elem556;
     for (int _i557 = 0; _i557 < _list555.size; ++_i557) {
       _elem556 = new NotificationEvent();
       _elem556.read(iprot);
       struct.events.add(_elem556);
     }
   }
   struct.setEventsIsSet(true);
 }
コード例 #2
0
 /** Performs a deep copy on <i>other</i>. */
 public NotificationEventResponse(NotificationEventResponse other) {
   if (other.isSetEvents()) {
     List<NotificationEvent> __this__events =
         new ArrayList<NotificationEvent>(other.events.size());
     for (NotificationEvent other_element : other.events) {
       __this__events.add(new NotificationEvent(other_element));
     }
     this.events = __this__events;
   }
 }
コード例 #3
0
  @Override
  public int compareTo(NotificationEventResponse other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetEvents()).compareTo(other.isSetEvents());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEvents()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.events, other.events);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
コード例 #4
0
  public boolean equals(NotificationEventResponse that) {
    if (that == null) return false;

    boolean this_present_events = true && this.isSetEvents();
    boolean that_present_events = true && that.isSetEvents();
    if (this_present_events || that_present_events) {
      if (!(this_present_events && that_present_events)) return false;
      if (!this.events.equals(that.events)) return false;
    }

    return true;
  }
コード例 #5
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, NotificationEventResponse 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: // EVENTS
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list550 = iprot.readListBegin();
             struct.events = new ArrayList<NotificationEvent>(_list550.size);
             NotificationEvent _elem551;
             for (int _i552 = 0; _i552 < _list550.size; ++_i552) {
               _elem551 = new NotificationEvent();
               _elem551.read(iprot);
               struct.events.add(_elem551);
             }
             iprot.readListEnd();
           }
           struct.setEventsIsSet(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();
   struct.validate();
 }
コード例 #6
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, NotificationEventResponse struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.events != null) {
        oprot.writeFieldBegin(EVENTS_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.events.size()));
          for (NotificationEvent _iter553 : struct.events) {
            _iter553.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }