diff options
Diffstat (limited to 'src/main/java/org/openslx/bwlp/thrift/iface/PresetNetRule.java')
-rw-r--r-- | src/main/java/org/openslx/bwlp/thrift/iface/PresetNetRule.java | 183 |
1 files changed, 79 insertions, 104 deletions
diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/PresetNetRule.java b/src/main/java/org/openslx/bwlp/thrift/iface/PresetNetRule.java index 262c8ac..215d8ba 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/PresetNetRule.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/PresetNetRule.java @@ -1,40 +1,13 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.15.0) * * 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") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.15.0)", date = "2021-12-17") public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, PresetNetRule._Fields>, java.io.Serializable, Cloneable, Comparable<PresetNetRule> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PresetNetRule"); @@ -42,15 +15,12 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre private static final org.apache.thrift.protocol.TField DISPLAY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("displayName", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField NET_RULES_FIELD_DESC = new org.apache.thrift.protocol.TField("netRules", org.apache.thrift.protocol.TType.LIST, (short)3); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new PresetNetRuleStandardSchemeFactory()); - schemes.put(TupleScheme.class, new PresetNetRuleTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new PresetNetRuleStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new PresetNetRuleTupleSchemeFactory(); public int ruleId; // required - public String displayName; // required - public List<NetRule> netRules; // required + public @org.apache.thrift.annotation.Nullable java.lang.String displayName; // required + public @org.apache.thrift.annotation.Nullable java.util.List<NetRule> netRules; // 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 { @@ -58,10 +28,10 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre DISPLAY_NAME((short)2, "displayName"), NET_RULES((short)3, "netRules"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -69,6 +39,7 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // RULE_ID @@ -88,21 +59,22 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -111,7 +83,7 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -119,9 +91,9 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre // isset id assignments private static final int __RULEID_ISSET_ID = 0; private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.RULE_ID, new org.apache.thrift.meta_data.FieldMetaData("ruleId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.DISPLAY_NAME, new org.apache.thrift.meta_data.FieldMetaData("displayName", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -129,7 +101,7 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre tmpMap.put(_Fields.NET_RULES, new org.apache.thrift.meta_data.FieldMetaData("netRules", 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, NetRule.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PresetNetRule.class, metaDataMap); } @@ -138,8 +110,8 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre public PresetNetRule( int ruleId, - String displayName, - List<NetRule> netRules) + java.lang.String displayName, + java.util.List<NetRule> netRules) { this(); this.ruleId = ruleId; @@ -158,7 +130,7 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre this.displayName = other.displayName; } if (other.isSetNetRules()) { - List<NetRule> __this__netRules = new ArrayList<NetRule>(other.netRules.size()); + java.util.List<NetRule> __this__netRules = new java.util.ArrayList<NetRule>(other.netRules.size()); for (NetRule other_element : other.netRules) { __this__netRules.add(new NetRule(other_element)); } @@ -189,23 +161,24 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre } public void unsetRuleId() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RULEID_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RULEID_ISSET_ID); } /** Returns true if field ruleId is set (has been assigned a value) and false otherwise */ public boolean isSetRuleId() { - return EncodingUtils.testBit(__isset_bitfield, __RULEID_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RULEID_ISSET_ID); } public void setRuleIdIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RULEID_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RULEID_ISSET_ID, value); } - public String getDisplayName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getDisplayName() { return this.displayName; } - public PresetNetRule setDisplayName(String displayName) { + public PresetNetRule setDisplayName(@org.apache.thrift.annotation.Nullable java.lang.String displayName) { this.displayName = displayName; return this; } @@ -229,22 +202,24 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre return (this.netRules == null) ? 0 : this.netRules.size(); } + @org.apache.thrift.annotation.Nullable public java.util.Iterator<NetRule> getNetRulesIterator() { return (this.netRules == null) ? null : this.netRules.iterator(); } public void addToNetRules(NetRule elem) { if (this.netRules == null) { - this.netRules = new ArrayList<NetRule>(); + this.netRules = new java.util.ArrayList<NetRule>(); } this.netRules.add(elem); } - public List<NetRule> getNetRules() { + @org.apache.thrift.annotation.Nullable + public java.util.List<NetRule> getNetRules() { return this.netRules; } - public PresetNetRule setNetRules(List<NetRule> netRules) { + public PresetNetRule setNetRules(@org.apache.thrift.annotation.Nullable java.util.List<NetRule> netRules) { this.netRules = netRules; return this; } @@ -264,13 +239,13 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case RULE_ID: if (value == null) { unsetRuleId(); } else { - setRuleId((Integer)value); + setRuleId((java.lang.Integer)value); } break; @@ -278,7 +253,7 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre if (value == null) { unsetDisplayName(); } else { - setDisplayName((String)value); + setDisplayName((java.lang.String)value); } break; @@ -286,14 +261,15 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre if (value == null) { unsetNetRules(); } else { - setNetRules((List<NetRule>)value); + setNetRules((java.util.List<NetRule>)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case RULE_ID: return getRuleId(); @@ -305,13 +281,13 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre return getNetRules(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -322,13 +298,11 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre case NET_RULES: return isSetNetRules(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { - if (that == null) - return false; + public boolean equals(java.lang.Object that) { if (that instanceof PresetNetRule) return this.equals((PresetNetRule)that); return false; @@ -337,6 +311,8 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre public boolean equals(PresetNetRule that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_ruleId = true; boolean that_present_ruleId = true; @@ -370,24 +346,19 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_ruleId = true; - list.add(present_ruleId); - if (present_ruleId) - list.add(ruleId); + hashCode = hashCode * 8191 + ruleId; - boolean present_displayName = true && (isSetDisplayName()); - list.add(present_displayName); - if (present_displayName) - list.add(displayName); + hashCode = hashCode * 8191 + ((isSetDisplayName()) ? 131071 : 524287); + if (isSetDisplayName()) + hashCode = hashCode * 8191 + displayName.hashCode(); - boolean present_netRules = true && (isSetNetRules()); - list.add(present_netRules); - if (present_netRules) - list.add(netRules); + hashCode = hashCode * 8191 + ((isSetNetRules()) ? 131071 : 524287); + if (isSetNetRules()) + hashCode = hashCode * 8191 + netRules.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -398,7 +369,7 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetRuleId()).compareTo(other.isSetRuleId()); + lastComparison = java.lang.Boolean.compare(isSetRuleId(), other.isSetRuleId()); if (lastComparison != 0) { return lastComparison; } @@ -408,7 +379,7 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre return lastComparison; } } - lastComparison = Boolean.valueOf(isSetDisplayName()).compareTo(other.isSetDisplayName()); + lastComparison = java.lang.Boolean.compare(isSetDisplayName(), other.isSetDisplayName()); if (lastComparison != 0) { return lastComparison; } @@ -418,7 +389,7 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNetRules()).compareTo(other.isSetNetRules()); + lastComparison = java.lang.Boolean.compare(isSetNetRules(), other.isSetNetRules()); if (lastComparison != 0) { return lastComparison; } @@ -431,21 +402,22 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("PresetNetRule("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("PresetNetRule("); boolean first = true; sb.append("ruleId:"); @@ -484,7 +456,7 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -494,13 +466,13 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre } } - private static class PresetNetRuleStandardSchemeFactory implements SchemeFactory { + private static class PresetNetRuleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public PresetNetRuleStandardScheme getScheme() { return new PresetNetRuleStandardScheme(); } } - private static class PresetNetRuleStandardScheme extends StandardScheme<PresetNetRule> { + private static class PresetNetRuleStandardScheme extends org.apache.thrift.scheme.StandardScheme<PresetNetRule> { public void read(org.apache.thrift.protocol.TProtocol iprot, PresetNetRule struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -532,8 +504,8 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list98 = iprot.readListBegin(); - struct.netRules = new ArrayList<NetRule>(_list98.size); - NetRule _elem99; + struct.netRules = new java.util.ArrayList<NetRule>(_list98.size); + @org.apache.thrift.annotation.Nullable NetRule _elem99; for (int _i100 = 0; _i100 < _list98.size; ++_i100) { _elem99 = new NetRule(); @@ -588,18 +560,18 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre } - private static class PresetNetRuleTupleSchemeFactory implements SchemeFactory { + private static class PresetNetRuleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public PresetNetRuleTupleScheme getScheme() { return new PresetNetRuleTupleScheme(); } } - private static class PresetNetRuleTupleScheme extends TupleScheme<PresetNetRule> { + private static class PresetNetRuleTupleScheme extends org.apache.thrift.scheme.TupleScheme<PresetNetRule> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, PresetNetRule struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetRuleId()) { optionals.set(0); } @@ -629,8 +601,8 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre @Override public void read(org.apache.thrift.protocol.TProtocol prot, PresetNetRule struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.ruleId = iprot.readI32(); struct.setRuleIdIsSet(true); @@ -641,9 +613,9 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre } if (incoming.get(2)) { { - org.apache.thrift.protocol.TList _list103 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.netRules = new ArrayList<NetRule>(_list103.size); - NetRule _elem104; + org.apache.thrift.protocol.TList _list103 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.netRules = new java.util.ArrayList<NetRule>(_list103.size); + @org.apache.thrift.annotation.Nullable NetRule _elem104; for (int _i105 = 0; _i105 < _list103.size; ++_i105) { _elem104 = new NetRule(); @@ -656,5 +628,8 @@ public class PresetNetRule implements org.apache.thrift.TBase<PresetNetRule, Pre } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } |