summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/bwlp/thrift/iface/PredefinedData.java
blob: 4032b4e238fbbab8b4a5f952d585d9f08388815f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.openslx.bwlp.thrift.iface;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2019-02-25")
public class PredefinedData implements org.apache.thrift.TBase<PredefinedData, PredefinedData._Fields>, java.io.Serializable, Cloneable, Comparable<PredefinedData> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PredefinedData");

  private static final org.apache.thrift.protocol.TField NET_SHARES_FIELD_DESC = new org.apache.thrift.protocol.TField("netShares", org.apache.thrift.protocol.TType.LIST, (short)1);
  private static final org.apache.thrift.protocol.TField LDAP_FILTER_FIELD_DESC = new org.apache.thrift.protocol.TField("ldapFilter", org.apache.thrift.protocol.TType.LIST, (short)2);
  private static final org.apache.thrift.protocol.TField RUN_SCRIPTS_FIELD_DESC = new org.apache.thrift.protocol.TField("runScripts", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField NETWORK_EXCEPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("networkExceptions", org.apache.thrift.protocol.TType.LIST, (short)4);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new PredefinedDataStandardSchemeFactory());
    schemes.put(TupleScheme.class, new PredefinedDataTupleSchemeFactory());
  }

  public List<NetShare> netShares; // required
  public List<LdapFilter> ldapFilter; // required
  public List<PresetRunScript> runScripts; // required
  public List<PresetNetRule> networkExceptions; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    NET_SHARES((short)1, "netShares"),
    LDAP_FILTER((short)2, "ldapFilter"),
    RUN_SCRIPTS((short)3, "runScripts"),
    NETWORK_EXCEPTIONS((short)4, "networkExceptions");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // NET_SHARES
          return NET_SHARES;
        case 2: // LDAP_FILTER
          return LDAP_FILTER;
        case 3: // RUN_SCRIPTS
          return RUN_SCRIPTS;
        case 4: // NETWORK_EXCEPTIONS
          return NETWORK_EXCEPTIONS;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.NET_SHARES, new org.apache.thrift.meta_data.FieldMetaData("netShares", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NetShare.class))));
    tmpMap.put(_Fields.LDAP_FILTER, new org.apache.thrift.meta_data.FieldMetaData("ldapFilter", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LdapFilter.class))));
    tmpMap.put(_Fields.RUN_SCRIPTS, new org.apache.thrift.meta_data.FieldMetaData("runScripts", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PresetRunScript.class))));
    tmpMap.put(_Fields.NETWORK_EXCEPTIONS, new org.apache.thrift.meta_data.FieldMetaData("networkExceptions", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PresetNetRule.class))));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PredefinedData.class, metaDataMap);
  }

  public PredefinedData() {
  }

  public PredefinedData(
    List<NetShare> netShares,
    List<LdapFilter> ldapFilter,
    List<PresetRunScript> runScripts,
    List<PresetNetRule> networkExceptions)
  {
    this();
    this.netShares = netShares;
    this.ldapFilter = ldapFilter;
    this.runScripts = runScripts;
    this.networkExceptions = networkExceptions;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public PredefinedData(PredefinedData other) {
    if (other.isSetNetShares()) {
      List<NetShare> __this__netShares = new ArrayList<NetShare>(other.netShares.size());
      for (NetShare other_element : other.netShares) {
        __this__netShares.add(new NetShare(other_element));
      }
      this.netShares = __this__netShares;
    }
    if (other.isSetLdapFilter()) {
      List<LdapFilter> __this__ldapFilter = new ArrayList<LdapFilter>(other.ldapFilter.size());
      for (LdapFilter other_element : other.ldapFilter) {
        __this__ldapFilter.add(new LdapFilter(other_element));
      }
      this.ldapFilter = __this__ldapFilter;
    }
    if (other.isSetRunScripts()) {
      List<PresetRunScript> __this__runScripts = new ArrayList<PresetRunScript>(other.runScripts.size());
      for (PresetRunScript other_element : other.runScripts) {
        __this__runScripts.add(new PresetRunScript(other_element));
      }
      this.runScripts = __this__runScripts;
    }
    if (other.isSetNetworkExceptions()) {
      List<PresetNetRule> __this__networkExceptions = new ArrayList<PresetNetRule>(other.networkExceptions.size());
      for (PresetNetRule other_element : other.networkExceptions) {
        __this__networkExceptions.add(new PresetNetRule(other_element));
      }
      this.networkExceptions = __this__networkExceptions;
    }
  }

  public PredefinedData deepCopy() {
    return new PredefinedData(this);
  }

  @Override
  public void clear() {
    this.netShares = null;
    this.ldapFilter = null;
    this.runScripts = null;
    this.networkExceptions = null;
  }

  public int getNetSharesSize() {
    return (this.netShares == null) ? 0 : this.netShares.size();
  }

  public java.util.Iterator<NetShare> getNetSharesIterator() {
    return (this.netShares == null) ? null : this.netShares.iterator();
  }

  public void addToNetShares(NetShare elem) {
    if (this.netShares == null) {
      this.netShares = new ArrayList<NetShare>();
    }
    this.netShares.add(elem);
  }

  public List<NetShare> getNetShares() {
    return this.netShares;
  }

  public PredefinedData setNetShares(List<NetShare> netShares) {
    this.netShares = netShares;
    return this;
  }

  public void unsetNetShares() {
    this.netShares = null;
  }

  /** Returns true if field netShares is set (has been assigned a value) and false otherwise */
  public boolean isSetNetShares() {
    return this.netShares != null;
  }

  public void setNetSharesIsSet(boolean value) {
    if (!value) {
      this.netShares = null;
    }
  }

  public int getLdapFilterSize() {
    return (this.ldapFilter == null) ? 0 : this.ldapFilter.size();
  }

  public java.util.Iterator<LdapFilter> getLdapFilterIterator() {
    return (this.ldapFilter == null) ? null : this.ldapFilter.iterator();
  }

  public void addToLdapFilter(LdapFilter elem) {
    if (this.ldapFilter == null) {
      this.ldapFilter = new ArrayList<LdapFilter>();
    }
    this.ldapFilter.add(elem);
  }

  public List<LdapFilter> getLdapFilter() {
    return this.ldapFilter;
  }

  public PredefinedData setLdapFilter(List<LdapFilter> ldapFilter) {
    this.ldapFilter = ldapFilter;
    return this;
  }

  public void unsetLdapFilter() {
    this.ldapFilter = null;
  }

  /** Returns true if field ldapFilter is set (has been assigned a value) and false otherwise */
  public boolean isSetLdapFilter() {
    return this.ldapFilter != null;
  }

  public void setLdapFilterIsSet(boolean value) {
    if (!value) {
      this.ldapFilter = null;
    }
  }

  public int getRunScriptsSize() {
    return (this.runScripts == null) ? 0 : this.runScripts.size();
  }

  public java.util.Iterator<PresetRunScript> getRunScriptsIterator() {
    return (this.runScripts == null) ? null : this.runScripts.iterator();
  }

  public void addToRunScripts(PresetRunScript elem) {
    if (this.runScripts == null) {
      this.runScripts = new ArrayList<PresetRunScript>();
    }
    this.runScripts.add(elem);
  }

  public List<PresetRunScript> getRunScripts() {
    return this.runScripts;
  }

  public PredefinedData setRunScripts(List<PresetRunScript> runScripts) {
    this.runScripts = runScripts;
    return this;
  }

  public void unsetRunScripts() {
    this.runScripts = null;
  }

  /** Returns true if field runScripts is set (has been assigned a value) and false otherwise */
  public boolean isSetRunScripts() {
    return this.runScripts != null;
  }

  public void setRunScriptsIsSet(boolean value) {
    if (!value) {
      this.runScripts = null;
    }
  }

  public int getNetworkExceptionsSize() {
    return (this.networkExceptions == null) ? 0 : this.networkExceptions.size();
  }

  public java.util.Iterator<PresetNetRule> getNetworkExceptionsIterator() {
    return (this.networkExceptions == null) ? null : this.networkExceptions.iterator();
  }

  public void addToNetworkExceptions(PresetNetRule elem) {
    if (this.networkExceptions == null) {
      this.networkExceptions = new ArrayList<PresetNetRule>();
    }
    this.networkExceptions.add(elem);
  }

  public List<PresetNetRule> getNetworkExceptions() {
    return this.networkExceptions;
  }

  public PredefinedData setNetworkExceptions(List<PresetNetRule> networkExceptions) {
    this.networkExceptions = networkExceptions;
    return this;
  }

  public void unsetNetworkExceptions() {
    this.networkExceptions = null;
  }

  /** Returns true if field networkExceptions is set (has been assigned a value) and false otherwise */
  public boolean isSetNetworkExceptions() {
    return this.networkExceptions != null;
  }

  public void setNetworkExceptionsIsSet(boolean value) {
    if (!value) {
      this.networkExceptions = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case NET_SHARES:
      if (value == null) {
        unsetNetShares();
      } else {
        setNetShares((List<NetShare>)value);
      }
      break;

    case LDAP_FILTER:
      if (value == null) {
        unsetLdapFilter();
      } else {
        setLdapFilter((List<LdapFilter>)value);
      }
      break;

    case RUN_SCRIPTS:
      if (value == null) {
        unsetRunScripts();
      } else {
        setRunScripts((List<PresetRunScript>)value);
      }
      break;

    case NETWORK_EXCEPTIONS:
      if (value == null) {
        unsetNetworkExceptions();
      } else {
        setNetworkExceptions((List<PresetNetRule>)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case NET_SHARES:
      return getNetShares();

    case LDAP_FILTER:
      return getLdapFilter();

    case RUN_SCRIPTS:
      return getRunScripts();

    case NETWORK_EXCEPTIONS:
      return getNetworkExceptions();

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case NET_SHARES:
      return isSetNetShares();
    case LDAP_FILTER:
      return isSetLdapFilter();
    case RUN_SCRIPTS:
      return isSetRunScripts();
    case NETWORK_EXCEPTIONS:
      return isSetNetworkExceptions();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof PredefinedData)
      return this.equals((PredefinedData)that);
    return false;
  }

  public boolean equals(PredefinedData that) {
    if (that == null)
      return false;

    boolean this_present_netShares = true && this.isSetNetShares();
    boolean that_present_netShares = true && that.isSetNetShares();
    if (this_present_netShares || that_present_netShares) {
      if (!(this_present_netShares && that_present_netShares))
        return false;
      if (!this.netShares.equals(that.netShares))
        return false;
    }

    boolean this_present_ldapFilter = true && this.isSetLdapFilter();
    boolean that_present_ldapFilter = true && that.isSetLdapFilter();
    if (this_present_ldapFilter || that_present_ldapFilter) {
      if (!(this_present_ldapFilter && that_present_ldapFilter))
        return false;
      if (!this.ldapFilter.equals(that.ldapFilter))
        return false;
    }

    boolean this_present_runScripts = true && this.isSetRunScripts();
    boolean that_present_runScripts = true && that.isSetRunScripts();
    if (this_present_runScripts || that_present_runScripts) {
      if (!(this_present_runScripts && that_present_runScripts))
        return false;
      if (!this.runScripts.equals(that.runScripts))
        return false;
    }

    boolean this_present_networkExceptions = true && this.isSetNetworkExceptions();
    boolean that_present_networkExceptions = true && that.isSetNetworkExceptions();
    if (this_present_networkExceptions || that_present_networkExceptions) {
      if (!(this_present_networkExceptions && that_present_networkExceptions))
        return false;
      if (!this.networkExceptions.equals(that.networkExceptions))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List<Object> list = new ArrayList<Object>();

    boolean present_netShares = true && (isSetNetShares());
    list.add(present_netShares);
    if (present_netShares)
      list.add(netShares);

    boolean present_ldapFilter = true && (isSetLdapFilter());
    list.add(present_ldapFilter);
    if (present_ldapFilter)
      list.add(ldapFilter);

    boolean present_runScripts = true && (isSetRunScripts());
    list.add(present_runScripts);
    if (present_runScripts)
      list.add(runScripts);

    boolean present_networkExceptions = true && (isSetNetworkExceptions());
    list.add(present_networkExceptions);
    if (present_networkExceptions)
      list.add(networkExceptions);

    return list.hashCode();
  }

  @Override
  public int compareTo(PredefinedData other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetNetShares()).compareTo(other.isSetNetShares());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNetShares()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.netShares, other.netShares);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLdapFilter()).compareTo(other.isSetLdapFilter());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLdapFilter()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ldapFilter, other.ldapFilter);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRunScripts()).compareTo(other.isSetRunScripts());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRunScripts()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.runScripts, other.runScripts);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetNetworkExceptions()).compareTo(other.isSetNetworkExceptions());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNetworkExceptions()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.networkExceptions, other.networkExceptions);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("PredefinedData(");
    boolean first = true;

    sb.append("netShares:");
    if (this.netShares == null) {
      sb.append("null");
    } else {
      sb.append(this.netShares);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("ldapFilter:");
    if (this.ldapFilter == null) {
      sb.append("null");
    } else {
      sb.append(this.ldapFilter);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("runScripts:");
    if (this.runScripts == null) {
      sb.append("null");
    } else {
      sb.append(this.runScripts);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("networkExceptions:");
    if (this.networkExceptions == null) {
      sb.append("null");
    } else {
      sb.append(this.networkExceptions);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class PredefinedDataStandardSchemeFactory implements SchemeFactory {
    public PredefinedDataStandardScheme getScheme() {
      return new PredefinedDataStandardScheme();
    }
  }

  private static class PredefinedDataStandardScheme extends StandardScheme<PredefinedData> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, PredefinedData 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: // NET_SHARES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list106 = iprot.readListBegin();
                struct.netShares = new ArrayList<NetShare>(_list106.size);
                NetShare _elem107;
                for (int _i108 = 0; _i108 < _list106.size; ++_i108)
                {
                  _elem107 = new NetShare();
                  _elem107.read(iprot);
                  struct.netShares.add(_elem107);
                }
                iprot.readListEnd();
              }
              struct.setNetSharesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // LDAP_FILTER
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list109 = iprot.readListBegin();
                struct.ldapFilter = new ArrayList<LdapFilter>(_list109.size);
                LdapFilter _elem110;
                for (int _i111 = 0; _i111 < _list109.size; ++_i111)
                {
                  _elem110 = new LdapFilter();
                  _elem110.read(iprot);
                  struct.ldapFilter.add(_elem110);
                }
                iprot.readListEnd();
              }
              struct.setLdapFilterIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // RUN_SCRIPTS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list112 = iprot.readListBegin();
                struct.runScripts = new ArrayList<PresetRunScript>(_list112.size);
                PresetRunScript _elem113;
                for (int _i114 = 0; _i114 < _list112.size; ++_i114)
                {
                  _elem113 = new PresetRunScript();
                  _elem113.read(iprot);
                  struct.runScripts.add(_elem113);
                }
                iprot.readListEnd();
              }
              struct.setRunScriptsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // NETWORK_EXCEPTIONS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list115 = iprot.readListBegin();
                struct.networkExceptions = new ArrayList<PresetNetRule>(_list115.size);
                PresetNetRule _elem116;
                for (int _i117 = 0; _i117 < _list115.size; ++_i117)
                {
                  _elem116 = new PresetNetRule();
                  _elem116.read(iprot);
                  struct.networkExceptions.add(_elem116);
                }
                iprot.readListEnd();
              }
              struct.setNetworkExceptionsIsSet(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();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, PredefinedData struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.netShares != null) {
        oprot.writeFieldBegin(NET_SHARES_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.netShares.size()));
          for (NetShare _iter118 : struct.netShares)
          {
            _iter118.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.ldapFilter != null) {
        oprot.writeFieldBegin(LDAP_FILTER_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.ldapFilter.size()));
          for (LdapFilter _iter119 : struct.ldapFilter)
          {
            _iter119.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.runScripts != null) {
        oprot.writeFieldBegin(RUN_SCRIPTS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.runScripts.size()));
          for (PresetRunScript _iter120 : struct.runScripts)
          {
            _iter120.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.networkExceptions != null) {
        oprot.writeFieldBegin(NETWORK_EXCEPTIONS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.networkExceptions.size()));
          for (PresetNetRule _iter121 : struct.networkExceptions)
          {
            _iter121.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class PredefinedDataTupleSchemeFactory implements SchemeFactory {
    public PredefinedDataTupleScheme getScheme() {
      return new PredefinedDataTupleScheme();
    }
  }

  private static class PredefinedDataTupleScheme extends TupleScheme<PredefinedData> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, PredefinedData struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetNetShares()) {
        optionals.set(0);
      }
      if (struct.isSetLdapFilter()) {
        optionals.set(1);
      }
      if (struct.isSetRunScripts()) {
        optionals.set(2);
      }
      if (struct.isSetNetworkExceptions()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetNetShares()) {
        {
          oprot.writeI32(struct.netShares.size());
          for (NetShare _iter122 : struct.netShares)
          {
            _iter122.write(oprot);
          }
        }
      }
      if (struct.isSetLdapFilter()) {
        {
          oprot.writeI32(struct.ldapFilter.size());
          for (LdapFilter _iter123 : struct.ldapFilter)
          {
            _iter123.write(oprot);
          }
        }
      }
      if (struct.isSetRunScripts()) {
        {
          oprot.writeI32(struct.runScripts.size());
          for (PresetRunScript _iter124 : struct.runScripts)
          {
            _iter124.write(oprot);
          }
        }
      }
      if (struct.isSetNetworkExceptions()) {
        {
          oprot.writeI32(struct.networkExceptions.size());
          for (PresetNetRule _iter125 : struct.networkExceptions)
          {
            _iter125.write(oprot);
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, PredefinedData struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TList _list126 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.netShares = new ArrayList<NetShare>(_list126.size);
          NetShare _elem127;
          for (int _i128 = 0; _i128 < _list126.size; ++_i128)
          {
            _elem127 = new NetShare();
            _elem127.read(iprot);
            struct.netShares.add(_elem127);
          }
        }
        struct.setNetSharesIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list129 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.ldapFilter = new ArrayList<LdapFilter>(_list129.size);
          LdapFilter _elem130;
          for (int _i131 = 0; _i131 < _list129.size; ++_i131)
          {
            _elem130 = new LdapFilter();
            _elem130.read(iprot);
            struct.ldapFilter.add(_elem130);
          }
        }
        struct.setLdapFilterIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list132 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.runScripts = new ArrayList<PresetRunScript>(_list132.size);
          PresetRunScript _elem133;
          for (int _i134 = 0; _i134 < _list132.size; ++_i134)
          {
            _elem133 = new PresetRunScript();
            _elem133.read(iprot);
            struct.runScripts.add(_elem133);
          }
        }
        struct.setRunScriptsIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list135 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.networkExceptions = new ArrayList<PresetNetRule>(_list135.size);
          PresetNetRule _elem136;
          for (int _i137 = 0; _i137 < _list135.size; ++_i137)
          {
            _elem136 = new PresetNetRule();
            _elem136.read(iprot);
            struct.networkExceptions.add(_elem136);
          }
        }
        struct.setNetworkExceptionsIsSet(true);
      }
    }
  }

}