PageRenderTime 55ms CodeModel.GetById 16ms app.highlight 34ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalPrivilegeSet.java

#
Java | 683 lines | 574 code | 84 blank | 25 comment | 125 complexity | d81040e9fb85b198fb76f6e93bc9f450 MD5 | raw file
  1/**
  2 * Autogenerated by Thrift
  3 *
  4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  5 */
  6package org.apache.hadoop.hive.metastore.api;
  7
  8import java.util.List;
  9import java.util.ArrayList;
 10import java.util.Map;
 11import java.util.HashMap;
 12import java.util.EnumMap;
 13import java.util.Set;
 14import java.util.HashSet;
 15import java.util.EnumSet;
 16import java.util.Collections;
 17import java.util.BitSet;
 18import java.nio.ByteBuffer;
 19import java.util.Arrays;
 20import org.slf4j.Logger;
 21import org.slf4j.LoggerFactory;
 22
 23import org.apache.thrift.*;
 24import org.apache.thrift.async.*;
 25import org.apache.thrift.meta_data.*;
 26import org.apache.thrift.transport.*;
 27import org.apache.thrift.protocol.*;
 28
 29public class PrincipalPrivilegeSet implements TBase<PrincipalPrivilegeSet, PrincipalPrivilegeSet._Fields>, java.io.Serializable, Cloneable {
 30  private static final TStruct STRUCT_DESC = new TStruct("PrincipalPrivilegeSet");
 31
 32  private static final TField USER_PRIVILEGES_FIELD_DESC = new TField("userPrivileges", TType.MAP, (short)1);
 33  private static final TField GROUP_PRIVILEGES_FIELD_DESC = new TField("groupPrivileges", TType.MAP, (short)2);
 34  private static final TField ROLE_PRIVILEGES_FIELD_DESC = new TField("rolePrivileges", TType.MAP, (short)3);
 35
 36  private Map<String,List<PrivilegeGrantInfo>> userPrivileges;
 37  private Map<String,List<PrivilegeGrantInfo>> groupPrivileges;
 38  private Map<String,List<PrivilegeGrantInfo>> rolePrivileges;
 39
 40  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
 41  public enum _Fields implements TFieldIdEnum {
 42    USER_PRIVILEGES((short)1, "userPrivileges"),
 43    GROUP_PRIVILEGES((short)2, "groupPrivileges"),
 44    ROLE_PRIVILEGES((short)3, "rolePrivileges");
 45
 46    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 47
 48    static {
 49      for (_Fields field : EnumSet.allOf(_Fields.class)) {
 50        byName.put(field.getFieldName(), field);
 51      }
 52    }
 53
 54    /**
 55     * Find the _Fields constant that matches fieldId, or null if its not found.
 56     */
 57    public static _Fields findByThriftId(int fieldId) {
 58      switch(fieldId) {
 59        case 1: // USER_PRIVILEGES
 60          return USER_PRIVILEGES;
 61        case 2: // GROUP_PRIVILEGES
 62          return GROUP_PRIVILEGES;
 63        case 3: // ROLE_PRIVILEGES
 64          return ROLE_PRIVILEGES;
 65        default:
 66          return null;
 67      }
 68    }
 69
 70    /**
 71     * Find the _Fields constant that matches fieldId, throwing an exception
 72     * if it is not found.
 73     */
 74    public static _Fields findByThriftIdOrThrow(int fieldId) {
 75      _Fields fields = findByThriftId(fieldId);
 76      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
 77      return fields;
 78    }
 79
 80    /**
 81     * Find the _Fields constant that matches name, or null if its not found.
 82     */
 83    public static _Fields findByName(String name) {
 84      return byName.get(name);
 85    }
 86
 87    private final short _thriftId;
 88    private final String _fieldName;
 89
 90    _Fields(short thriftId, String fieldName) {
 91      _thriftId = thriftId;
 92      _fieldName = fieldName;
 93    }
 94
 95    public short getThriftFieldId() {
 96      return _thriftId;
 97    }
 98
 99    public String getFieldName() {
100      return _fieldName;
101    }
102  }
103
104  // isset id assignments
105
106  public static final Map<_Fields, FieldMetaData> metaDataMap;
107  static {
108    Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
109    tmpMap.put(_Fields.USER_PRIVILEGES, new FieldMetaData("userPrivileges", TFieldRequirementType.DEFAULT, 
110        new MapMetaData(TType.MAP, 
111            new FieldValueMetaData(TType.STRING), 
112            new ListMetaData(TType.LIST, 
113                new StructMetaData(TType.STRUCT, PrivilegeGrantInfo.class)))));
114    tmpMap.put(_Fields.GROUP_PRIVILEGES, new FieldMetaData("groupPrivileges", TFieldRequirementType.DEFAULT, 
115        new MapMetaData(TType.MAP, 
116            new FieldValueMetaData(TType.STRING), 
117            new ListMetaData(TType.LIST, 
118                new StructMetaData(TType.STRUCT, PrivilegeGrantInfo.class)))));
119    tmpMap.put(_Fields.ROLE_PRIVILEGES, new FieldMetaData("rolePrivileges", TFieldRequirementType.DEFAULT, 
120        new MapMetaData(TType.MAP, 
121            new FieldValueMetaData(TType.STRING), 
122            new ListMetaData(TType.LIST, 
123                new StructMetaData(TType.STRUCT, PrivilegeGrantInfo.class)))));
124    metaDataMap = Collections.unmodifiableMap(tmpMap);
125    FieldMetaData.addStructMetaDataMap(PrincipalPrivilegeSet.class, metaDataMap);
126  }
127
128  public PrincipalPrivilegeSet() {
129  }
130
131  public PrincipalPrivilegeSet(
132    Map<String,List<PrivilegeGrantInfo>> userPrivileges,
133    Map<String,List<PrivilegeGrantInfo>> groupPrivileges,
134    Map<String,List<PrivilegeGrantInfo>> rolePrivileges)
135  {
136    this();
137    this.userPrivileges = userPrivileges;
138    this.groupPrivileges = groupPrivileges;
139    this.rolePrivileges = rolePrivileges;
140  }
141
142  /**
143   * Performs a deep copy on <i>other</i>.
144   */
145  public PrincipalPrivilegeSet(PrincipalPrivilegeSet other) {
146    if (other.isSetUserPrivileges()) {
147      Map<String,List<PrivilegeGrantInfo>> __this__userPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
148      for (Map.Entry<String, List<PrivilegeGrantInfo>> other_element : other.userPrivileges.entrySet()) {
149
150        String other_element_key = other_element.getKey();
151        List<PrivilegeGrantInfo> other_element_value = other_element.getValue();
152
153        String __this__userPrivileges_copy_key = other_element_key;
154
155        List<PrivilegeGrantInfo> __this__userPrivileges_copy_value = new ArrayList<PrivilegeGrantInfo>();
156        for (PrivilegeGrantInfo other_element_value_element : other_element_value) {
157          __this__userPrivileges_copy_value.add(new PrivilegeGrantInfo(other_element_value_element));
158        }
159
160        __this__userPrivileges.put(__this__userPrivileges_copy_key, __this__userPrivileges_copy_value);
161      }
162      this.userPrivileges = __this__userPrivileges;
163    }
164    if (other.isSetGroupPrivileges()) {
165      Map<String,List<PrivilegeGrantInfo>> __this__groupPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
166      for (Map.Entry<String, List<PrivilegeGrantInfo>> other_element : other.groupPrivileges.entrySet()) {
167
168        String other_element_key = other_element.getKey();
169        List<PrivilegeGrantInfo> other_element_value = other_element.getValue();
170
171        String __this__groupPrivileges_copy_key = other_element_key;
172
173        List<PrivilegeGrantInfo> __this__groupPrivileges_copy_value = new ArrayList<PrivilegeGrantInfo>();
174        for (PrivilegeGrantInfo other_element_value_element : other_element_value) {
175          __this__groupPrivileges_copy_value.add(new PrivilegeGrantInfo(other_element_value_element));
176        }
177
178        __this__groupPrivileges.put(__this__groupPrivileges_copy_key, __this__groupPrivileges_copy_value);
179      }
180      this.groupPrivileges = __this__groupPrivileges;
181    }
182    if (other.isSetRolePrivileges()) {
183      Map<String,List<PrivilegeGrantInfo>> __this__rolePrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
184      for (Map.Entry<String, List<PrivilegeGrantInfo>> other_element : other.rolePrivileges.entrySet()) {
185
186        String other_element_key = other_element.getKey();
187        List<PrivilegeGrantInfo> other_element_value = other_element.getValue();
188
189        String __this__rolePrivileges_copy_key = other_element_key;
190
191        List<PrivilegeGrantInfo> __this__rolePrivileges_copy_value = new ArrayList<PrivilegeGrantInfo>();
192        for (PrivilegeGrantInfo other_element_value_element : other_element_value) {
193          __this__rolePrivileges_copy_value.add(new PrivilegeGrantInfo(other_element_value_element));
194        }
195
196        __this__rolePrivileges.put(__this__rolePrivileges_copy_key, __this__rolePrivileges_copy_value);
197      }
198      this.rolePrivileges = __this__rolePrivileges;
199    }
200  }
201
202  public PrincipalPrivilegeSet deepCopy() {
203    return new PrincipalPrivilegeSet(this);
204  }
205
206  @Override
207  public void clear() {
208    this.userPrivileges = null;
209    this.groupPrivileges = null;
210    this.rolePrivileges = null;
211  }
212
213  public int getUserPrivilegesSize() {
214    return (this.userPrivileges == null) ? 0 : this.userPrivileges.size();
215  }
216
217  public void putToUserPrivileges(String key, List<PrivilegeGrantInfo> val) {
218    if (this.userPrivileges == null) {
219      this.userPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
220    }
221    this.userPrivileges.put(key, val);
222  }
223
224  public Map<String,List<PrivilegeGrantInfo>> getUserPrivileges() {
225    return this.userPrivileges;
226  }
227
228  public void setUserPrivileges(Map<String,List<PrivilegeGrantInfo>> userPrivileges) {
229    this.userPrivileges = userPrivileges;
230  }
231
232  public void unsetUserPrivileges() {
233    this.userPrivileges = null;
234  }
235
236  /** Returns true if field userPrivileges is set (has been asigned a value) and false otherwise */
237  public boolean isSetUserPrivileges() {
238    return this.userPrivileges != null;
239  }
240
241  public void setUserPrivilegesIsSet(boolean value) {
242    if (!value) {
243      this.userPrivileges = null;
244    }
245  }
246
247  public int getGroupPrivilegesSize() {
248    return (this.groupPrivileges == null) ? 0 : this.groupPrivileges.size();
249  }
250
251  public void putToGroupPrivileges(String key, List<PrivilegeGrantInfo> val) {
252    if (this.groupPrivileges == null) {
253      this.groupPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
254    }
255    this.groupPrivileges.put(key, val);
256  }
257
258  public Map<String,List<PrivilegeGrantInfo>> getGroupPrivileges() {
259    return this.groupPrivileges;
260  }
261
262  public void setGroupPrivileges(Map<String,List<PrivilegeGrantInfo>> groupPrivileges) {
263    this.groupPrivileges = groupPrivileges;
264  }
265
266  public void unsetGroupPrivileges() {
267    this.groupPrivileges = null;
268  }
269
270  /** Returns true if field groupPrivileges is set (has been asigned a value) and false otherwise */
271  public boolean isSetGroupPrivileges() {
272    return this.groupPrivileges != null;
273  }
274
275  public void setGroupPrivilegesIsSet(boolean value) {
276    if (!value) {
277      this.groupPrivileges = null;
278    }
279  }
280
281  public int getRolePrivilegesSize() {
282    return (this.rolePrivileges == null) ? 0 : this.rolePrivileges.size();
283  }
284
285  public void putToRolePrivileges(String key, List<PrivilegeGrantInfo> val) {
286    if (this.rolePrivileges == null) {
287      this.rolePrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
288    }
289    this.rolePrivileges.put(key, val);
290  }
291
292  public Map<String,List<PrivilegeGrantInfo>> getRolePrivileges() {
293    return this.rolePrivileges;
294  }
295
296  public void setRolePrivileges(Map<String,List<PrivilegeGrantInfo>> rolePrivileges) {
297    this.rolePrivileges = rolePrivileges;
298  }
299
300  public void unsetRolePrivileges() {
301    this.rolePrivileges = null;
302  }
303
304  /** Returns true if field rolePrivileges is set (has been asigned a value) and false otherwise */
305  public boolean isSetRolePrivileges() {
306    return this.rolePrivileges != null;
307  }
308
309  public void setRolePrivilegesIsSet(boolean value) {
310    if (!value) {
311      this.rolePrivileges = null;
312    }
313  }
314
315  public void setFieldValue(_Fields field, Object value) {
316    switch (field) {
317    case USER_PRIVILEGES:
318      if (value == null) {
319        unsetUserPrivileges();
320      } else {
321        setUserPrivileges((Map<String,List<PrivilegeGrantInfo>>)value);
322      }
323      break;
324
325    case GROUP_PRIVILEGES:
326      if (value == null) {
327        unsetGroupPrivileges();
328      } else {
329        setGroupPrivileges((Map<String,List<PrivilegeGrantInfo>>)value);
330      }
331      break;
332
333    case ROLE_PRIVILEGES:
334      if (value == null) {
335        unsetRolePrivileges();
336      } else {
337        setRolePrivileges((Map<String,List<PrivilegeGrantInfo>>)value);
338      }
339      break;
340
341    }
342  }
343
344  public Object getFieldValue(_Fields field) {
345    switch (field) {
346    case USER_PRIVILEGES:
347      return getUserPrivileges();
348
349    case GROUP_PRIVILEGES:
350      return getGroupPrivileges();
351
352    case ROLE_PRIVILEGES:
353      return getRolePrivileges();
354
355    }
356    throw new IllegalStateException();
357  }
358
359  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
360  public boolean isSet(_Fields field) {
361    if (field == null) {
362      throw new IllegalArgumentException();
363    }
364
365    switch (field) {
366    case USER_PRIVILEGES:
367      return isSetUserPrivileges();
368    case GROUP_PRIVILEGES:
369      return isSetGroupPrivileges();
370    case ROLE_PRIVILEGES:
371      return isSetRolePrivileges();
372    }
373    throw new IllegalStateException();
374  }
375
376  @Override
377  public boolean equals(Object that) {
378    if (that == null)
379      return false;
380    if (that instanceof PrincipalPrivilegeSet)
381      return this.equals((PrincipalPrivilegeSet)that);
382    return false;
383  }
384
385  public boolean equals(PrincipalPrivilegeSet that) {
386    if (that == null)
387      return false;
388
389    boolean this_present_userPrivileges = true && this.isSetUserPrivileges();
390    boolean that_present_userPrivileges = true && that.isSetUserPrivileges();
391    if (this_present_userPrivileges || that_present_userPrivileges) {
392      if (!(this_present_userPrivileges && that_present_userPrivileges))
393        return false;
394      if (!this.userPrivileges.equals(that.userPrivileges))
395        return false;
396    }
397
398    boolean this_present_groupPrivileges = true && this.isSetGroupPrivileges();
399    boolean that_present_groupPrivileges = true && that.isSetGroupPrivileges();
400    if (this_present_groupPrivileges || that_present_groupPrivileges) {
401      if (!(this_present_groupPrivileges && that_present_groupPrivileges))
402        return false;
403      if (!this.groupPrivileges.equals(that.groupPrivileges))
404        return false;
405    }
406
407    boolean this_present_rolePrivileges = true && this.isSetRolePrivileges();
408    boolean that_present_rolePrivileges = true && that.isSetRolePrivileges();
409    if (this_present_rolePrivileges || that_present_rolePrivileges) {
410      if (!(this_present_rolePrivileges && that_present_rolePrivileges))
411        return false;
412      if (!this.rolePrivileges.equals(that.rolePrivileges))
413        return false;
414    }
415
416    return true;
417  }
418
419  @Override
420  public int hashCode() {
421    return 0;
422  }
423
424  public int compareTo(PrincipalPrivilegeSet other) {
425    if (!getClass().equals(other.getClass())) {
426      return getClass().getName().compareTo(other.getClass().getName());
427    }
428
429    int lastComparison = 0;
430    PrincipalPrivilegeSet typedOther = (PrincipalPrivilegeSet)other;
431
432    lastComparison = Boolean.valueOf(isSetUserPrivileges()).compareTo(typedOther.isSetUserPrivileges());
433    if (lastComparison != 0) {
434      return lastComparison;
435    }
436    if (isSetUserPrivileges()) {
437      lastComparison = TBaseHelper.compareTo(this.userPrivileges, typedOther.userPrivileges);
438      if (lastComparison != 0) {
439        return lastComparison;
440      }
441    }
442    lastComparison = Boolean.valueOf(isSetGroupPrivileges()).compareTo(typedOther.isSetGroupPrivileges());
443    if (lastComparison != 0) {
444      return lastComparison;
445    }
446    if (isSetGroupPrivileges()) {
447      lastComparison = TBaseHelper.compareTo(this.groupPrivileges, typedOther.groupPrivileges);
448      if (lastComparison != 0) {
449        return lastComparison;
450      }
451    }
452    lastComparison = Boolean.valueOf(isSetRolePrivileges()).compareTo(typedOther.isSetRolePrivileges());
453    if (lastComparison != 0) {
454      return lastComparison;
455    }
456    if (isSetRolePrivileges()) {
457      lastComparison = TBaseHelper.compareTo(this.rolePrivileges, typedOther.rolePrivileges);
458      if (lastComparison != 0) {
459        return lastComparison;
460      }
461    }
462    return 0;
463  }
464
465  public _Fields fieldForId(int fieldId) {
466    return _Fields.findByThriftId(fieldId);
467  }
468
469  public void read(TProtocol iprot) throws TException {
470    TField field;
471    iprot.readStructBegin();
472    while (true)
473    {
474      field = iprot.readFieldBegin();
475      if (field.type == TType.STOP) { 
476        break;
477      }
478      switch (field.id) {
479        case 1: // USER_PRIVILEGES
480          if (field.type == TType.MAP) {
481            {
482              TMap _map12 = iprot.readMapBegin();
483              this.userPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map12.size);
484              for (int _i13 = 0; _i13 < _map12.size; ++_i13)
485              {
486                String _key14;
487                List<PrivilegeGrantInfo> _val15;
488                _key14 = iprot.readString();
489                {
490                  TList _list16 = iprot.readListBegin();
491                  _val15 = new ArrayList<PrivilegeGrantInfo>(_list16.size);
492                  for (int _i17 = 0; _i17 < _list16.size; ++_i17)
493                  {
494                    PrivilegeGrantInfo _elem18;
495                    _elem18 = new PrivilegeGrantInfo();
496                    _elem18.read(iprot);
497                    _val15.add(_elem18);
498                  }
499                  iprot.readListEnd();
500                }
501                this.userPrivileges.put(_key14, _val15);
502              }
503              iprot.readMapEnd();
504            }
505          } else { 
506            TProtocolUtil.skip(iprot, field.type);
507          }
508          break;
509        case 2: // GROUP_PRIVILEGES
510          if (field.type == TType.MAP) {
511            {
512              TMap _map19 = iprot.readMapBegin();
513              this.groupPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map19.size);
514              for (int _i20 = 0; _i20 < _map19.size; ++_i20)
515              {
516                String _key21;
517                List<PrivilegeGrantInfo> _val22;
518                _key21 = iprot.readString();
519                {
520                  TList _list23 = iprot.readListBegin();
521                  _val22 = new ArrayList<PrivilegeGrantInfo>(_list23.size);
522                  for (int _i24 = 0; _i24 < _list23.size; ++_i24)
523                  {
524                    PrivilegeGrantInfo _elem25;
525                    _elem25 = new PrivilegeGrantInfo();
526                    _elem25.read(iprot);
527                    _val22.add(_elem25);
528                  }
529                  iprot.readListEnd();
530                }
531                this.groupPrivileges.put(_key21, _val22);
532              }
533              iprot.readMapEnd();
534            }
535          } else { 
536            TProtocolUtil.skip(iprot, field.type);
537          }
538          break;
539        case 3: // ROLE_PRIVILEGES
540          if (field.type == TType.MAP) {
541            {
542              TMap _map26 = iprot.readMapBegin();
543              this.rolePrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map26.size);
544              for (int _i27 = 0; _i27 < _map26.size; ++_i27)
545              {
546                String _key28;
547                List<PrivilegeGrantInfo> _val29;
548                _key28 = iprot.readString();
549                {
550                  TList _list30 = iprot.readListBegin();
551                  _val29 = new ArrayList<PrivilegeGrantInfo>(_list30.size);
552                  for (int _i31 = 0; _i31 < _list30.size; ++_i31)
553                  {
554                    PrivilegeGrantInfo _elem32;
555                    _elem32 = new PrivilegeGrantInfo();
556                    _elem32.read(iprot);
557                    _val29.add(_elem32);
558                  }
559                  iprot.readListEnd();
560                }
561                this.rolePrivileges.put(_key28, _val29);
562              }
563              iprot.readMapEnd();
564            }
565          } else { 
566            TProtocolUtil.skip(iprot, field.type);
567          }
568          break;
569        default:
570          TProtocolUtil.skip(iprot, field.type);
571      }
572      iprot.readFieldEnd();
573    }
574    iprot.readStructEnd();
575    validate();
576  }
577
578  public void write(TProtocol oprot) throws TException {
579    validate();
580
581    oprot.writeStructBegin(STRUCT_DESC);
582    if (this.userPrivileges != null) {
583      oprot.writeFieldBegin(USER_PRIVILEGES_FIELD_DESC);
584      {
585        oprot.writeMapBegin(new TMap(TType.STRING, TType.LIST, this.userPrivileges.size()));
586        for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter33 : this.userPrivileges.entrySet())
587        {
588          oprot.writeString(_iter33.getKey());
589          {
590            oprot.writeListBegin(new TList(TType.STRUCT, _iter33.getValue().size()));
591            for (PrivilegeGrantInfo _iter34 : _iter33.getValue())
592            {
593              _iter34.write(oprot);
594            }
595            oprot.writeListEnd();
596          }
597        }
598        oprot.writeMapEnd();
599      }
600      oprot.writeFieldEnd();
601    }
602    if (this.groupPrivileges != null) {
603      oprot.writeFieldBegin(GROUP_PRIVILEGES_FIELD_DESC);
604      {
605        oprot.writeMapBegin(new TMap(TType.STRING, TType.LIST, this.groupPrivileges.size()));
606        for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter35 : this.groupPrivileges.entrySet())
607        {
608          oprot.writeString(_iter35.getKey());
609          {
610            oprot.writeListBegin(new TList(TType.STRUCT, _iter35.getValue().size()));
611            for (PrivilegeGrantInfo _iter36 : _iter35.getValue())
612            {
613              _iter36.write(oprot);
614            }
615            oprot.writeListEnd();
616          }
617        }
618        oprot.writeMapEnd();
619      }
620      oprot.writeFieldEnd();
621    }
622    if (this.rolePrivileges != null) {
623      oprot.writeFieldBegin(ROLE_PRIVILEGES_FIELD_DESC);
624      {
625        oprot.writeMapBegin(new TMap(TType.STRING, TType.LIST, this.rolePrivileges.size()));
626        for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter37 : this.rolePrivileges.entrySet())
627        {
628          oprot.writeString(_iter37.getKey());
629          {
630            oprot.writeListBegin(new TList(TType.STRUCT, _iter37.getValue().size()));
631            for (PrivilegeGrantInfo _iter38 : _iter37.getValue())
632            {
633              _iter38.write(oprot);
634            }
635            oprot.writeListEnd();
636          }
637        }
638        oprot.writeMapEnd();
639      }
640      oprot.writeFieldEnd();
641    }
642    oprot.writeFieldStop();
643    oprot.writeStructEnd();
644  }
645
646  @Override
647  public String toString() {
648    StringBuilder sb = new StringBuilder("PrincipalPrivilegeSet(");
649    boolean first = true;
650
651    sb.append("userPrivileges:");
652    if (this.userPrivileges == null) {
653      sb.append("null");
654    } else {
655      sb.append(this.userPrivileges);
656    }
657    first = false;
658    if (!first) sb.append(", ");
659    sb.append("groupPrivileges:");
660    if (this.groupPrivileges == null) {
661      sb.append("null");
662    } else {
663      sb.append(this.groupPrivileges);
664    }
665    first = false;
666    if (!first) sb.append(", ");
667    sb.append("rolePrivileges:");
668    if (this.rolePrivileges == null) {
669      sb.append("null");
670    } else {
671      sb.append(this.rolePrivileges);
672    }
673    first = false;
674    sb.append(")");
675    return sb.toString();
676  }
677
678  public void validate() throws TException {
679    // check for required fields
680  }
681
682}
683