@Override
 public void clear() {
   setMenuItemIdIsSet(false);
   this.menuItemId = 0;
   this.singleChoiceOptions = null;
   this.multiChoiceOptions = null;
   this.comments = null;
 }
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true) {
      field = iprot.readFieldBegin();
      if (field.type == org.apache.thrift.protocol.TType.STOP) {
        break;
      }
      switch (field.id) {
        case 1: // MENU_ITEM_ID
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.menuItemId = iprot.readI64();
            setMenuItemIdIsSet(true);
          } else {
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // SINGLE_CHOICE_OPTIONS
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
            {
              org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
              this.singleChoiceOptions =
                  new ArrayList<
                      org.pocketcampus.platform.sdk.shared.common.ChosenSingleChoiceOption>(
                      _list16.size);
              for (int _i17 = 0; _i17 < _list16.size; ++_i17) {
                org.pocketcampus.platform.sdk.shared.common.ChosenSingleChoiceOption
                    _elem18; // required
                _elem18 =
                    new org.pocketcampus.platform.sdk.shared.common.ChosenSingleChoiceOption();
                _elem18.read(iprot);
                this.singleChoiceOptions.add(_elem18);
              }
              iprot.readListEnd();
            }
          } else {
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // MULTI_CHOICE_OPTIONS
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
            {
              org.apache.thrift.protocol.TList _list19 = iprot.readListBegin();
              this.multiChoiceOptions =
                  new ArrayList<
                      org.pocketcampus.platform.sdk.shared.common.ChosenMultiChoiceOption>(
                      _list19.size);
              for (int _i20 = 0; _i20 < _list19.size; ++_i20) {
                org.pocketcampus.platform.sdk.shared.common.ChosenMultiChoiceOption
                    _elem21; // required
                _elem21 = new org.pocketcampus.platform.sdk.shared.common.ChosenMultiChoiceOption();
                _elem21.read(iprot);
                this.multiChoiceOptions.add(_elem21);
              }
              iprot.readListEnd();
            }
          } else {
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // COMMENTS
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
            this.comments = iprot.readString();
          } else {
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    if (!isSetMenuItemId()) {
      throw new org.apache.thrift.protocol.TProtocolException(
          "Required field 'menuItemId' was not found in serialized data! Struct: " + toString());
    }
    validate();
  }
 public ChosenMenuItem setMenuItemId(long menuItemId) {
   this.menuItemId = menuItemId;
   setMenuItemIdIsSet(true);
   return this;
 }
 public ChosenMenuItem(long menuItemId) {
   this();
   this.menuItemId = menuItemId;
   setMenuItemIdIsSet(true);
 }