public void read()

in library/src/main/java/com/theguardian/bridget/thrift/AdSlot.java [489:548]


    public void read(org.apache.thrift.protocol.TProtocol iprot, AdSlot 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: // RECT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.rect = new Rect();
              struct.rect.read(iprot);
              struct.setRectIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TARGETING_PARAMS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
                struct.targetingParams = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map0.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key1;
                @org.apache.thrift.annotation.Nullable java.lang.String _val2;
                for (int _i3 = 0; _i3 < _map0.size; ++_i3)
                {
                  _key1 = iprot.readString();
                  _val2 = iprot.readString();
                  struct.targetingParams.put(_key1, _val2);
                }
                iprot.readMapEnd();
              }
              struct.setTargetingParamsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // IS_SQUARE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.isSquare = iprot.readBool();
              struct.setIsSquareIsSet(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
      if (!struct.isSetIsSquare()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'isSquare' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }