/** * 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; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.15.0)", date = "2021-12-17") public class PresetRunScript implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PresetRunScript"); private static final org.apache.thrift.protocol.TField SCRIPT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("scriptId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField DISPLAYNAME_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 OS_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("osIds", org.apache.thrift.protocol.TType.LIST, (short)3); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new PresetRunScriptStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new PresetRunScriptTupleSchemeFactory(); public int scriptId; // required public @org.apache.thrift.annotation.Nullable java.lang.String displayname; // required public @org.apache.thrift.annotation.Nullable java.util.List osIds; // 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 { SCRIPT_ID((short)1, "scriptId"), DISPLAYNAME((short)2, "displayname"), OS_IDS((short)3, "osIds"); private static final java.util.Map byName = new java.util.HashMap(); static { for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * 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: // SCRIPT_ID return SCRIPT_ID; case 2: // DISPLAYNAME return DISPLAYNAME; case 3: // OS_IDS return OS_IDS; 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ @org.apache.thrift.annotation.Nullable public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; private final java.lang.String _fieldName; _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final int __SCRIPTID_ISSET_ID = 0; private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { 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.SCRIPT_ID, new org.apache.thrift.meta_data.FieldMetaData("scriptId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.DISPLAYNAME, new org.apache.thrift.meta_data.FieldMetaData("displayname", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OS_IDS, new org.apache.thrift.meta_data.FieldMetaData("osIds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PresetRunScript.class, metaDataMap); } public PresetRunScript() { } public PresetRunScript( int scriptId, java.lang.String displayname, java.util.List osIds) { this(); this.scriptId = scriptId; setScriptIdIsSet(true); this.displayname = displayname; this.osIds = osIds; } /** * Performs a deep copy on other. */ public PresetRunScript(PresetRunScript other) { __isset_bitfield = other.__isset_bitfield; this.scriptId = other.scriptId; if (other.isSetDisplayname()) { this.displayname = other.displayname; } if (other.isSetOsIds()) { java.util.List __this__osIds = new java.util.ArrayList(other.osIds); this.osIds = __this__osIds; } } public PresetRunScript deepCopy() { return new PresetRunScript(this); } @Override public void clear() { setScriptIdIsSet(false); this.scriptId = 0; this.displayname = null; this.osIds = null; } public int getScriptId() { return this.scriptId; } public PresetRunScript setScriptId(int scriptId) { this.scriptId = scriptId; setScriptIdIsSet(true); return this; } public void unsetScriptId() { __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SCRIPTID_ISSET_ID); } /** Returns true if field scriptId is set (has been assigned a value) and false otherwise */ public boolean isSetScriptId() { return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SCRIPTID_ISSET_ID); } public void setScriptIdIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SCRIPTID_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable public java.lang.String getDisplayname() { return this.displayname; } public PresetRunScript setDisplayname(@org.apache.thrift.annotation.Nullable java.lang.String displayname) { this.displayname = displayname; return this; } public void unsetDisplayname() { this.displayname = null; } /** Returns true if field displayname is set (has been assigned a value) and false otherwise */ public boolean isSetDisplayname() { return this.displayname != null; } public void setDisplaynameIsSet(boolean value) { if (!value) { this.displayname = null; } } public int getOsIdsSize() { return (this.osIds == null) ? 0 : this.osIds.size(); } @org.apache.thrift.annotation.Nullable public java.util.Iterator getOsIdsIterator() { return (this.osIds == null) ? null : this.osIds.iterator(); } public void addToOsIds(int elem) { if (this.osIds == null) { this.osIds = new java.util.ArrayList(); } this.osIds.add(elem); } @org.apache.thrift.annotation.Nullable public java.util.List getOsIds() { return this.osIds; } public PresetRunScript setOsIds(@org.apache.thrift.annotation.Nullable java.util.List osIds) { this.osIds = osIds; return this; } public void unsetOsIds() { this.osIds = null; } /** Returns true if field osIds is set (has been assigned a value) and false otherwise */ public boolean isSetOsIds() { return this.osIds != null; } public void setOsIdsIsSet(boolean value) { if (!value) { this.osIds = null; } } public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SCRIPT_ID: if (value == null) { unsetScriptId(); } else { setScriptId((java.lang.Integer)value); } break; case DISPLAYNAME: if (value == null) { unsetDisplayname(); } else { setDisplayname((java.lang.String)value); } break; case OS_IDS: if (value == null) { unsetOsIds(); } else { setOsIds((java.util.List)value); } break; } } @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SCRIPT_ID: return getScriptId(); case DISPLAYNAME: return getDisplayname(); case OS_IDS: return getOsIds(); } 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 java.lang.IllegalArgumentException(); } switch (field) { case SCRIPT_ID: return isSetScriptId(); case DISPLAYNAME: return isSetDisplayname(); case OS_IDS: return isSetOsIds(); } throw new java.lang.IllegalStateException(); } @Override public boolean equals(java.lang.Object that) { if (that instanceof PresetRunScript) return this.equals((PresetRunScript)that); return false; } public boolean equals(PresetRunScript that) { if (that == null) return false; if (this == that) return true; boolean this_present_scriptId = true; boolean that_present_scriptId = true; if (this_present_scriptId || that_present_scriptId) { if (!(this_present_scriptId && that_present_scriptId)) return false; if (this.scriptId != that.scriptId) return false; } boolean this_present_displayname = true && this.isSetDisplayname(); boolean that_present_displayname = true && that.isSetDisplayname(); if (this_present_displayname || that_present_displayname) { if (!(this_present_displayname && that_present_displayname)) return false; if (!this.displayname.equals(that.displayname)) return false; } boolean this_present_osIds = true && this.isSetOsIds(); boolean that_present_osIds = true && that.isSetOsIds(); if (this_present_osIds || that_present_osIds) { if (!(this_present_osIds && that_present_osIds)) return false; if (!this.osIds.equals(that.osIds)) return false; } return true; } @Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + scriptId; hashCode = hashCode * 8191 + ((isSetDisplayname()) ? 131071 : 524287); if (isSetDisplayname()) hashCode = hashCode * 8191 + displayname.hashCode(); hashCode = hashCode * 8191 + ((isSetOsIds()) ? 131071 : 524287); if (isSetOsIds()) hashCode = hashCode * 8191 + osIds.hashCode(); return hashCode; } @Override public int compareTo(PresetRunScript other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.compare(isSetScriptId(), other.isSetScriptId()); if (lastComparison != 0) { return lastComparison; } if (isSetScriptId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scriptId, other.scriptId); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetDisplayname(), other.isSetDisplayname()); if (lastComparison != 0) { return lastComparison; } if (isSetDisplayname()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.displayname, other.displayname); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.compare(isSetOsIds(), other.isSetOsIds()); if (lastComparison != 0) { return lastComparison; } if (isSetOsIds()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.osIds, other.osIds); if (lastComparison != 0) { return lastComparison; } } 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 { scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @Override public java.lang.String toString() { java.lang.StringBuilder sb = new java.lang.StringBuilder("PresetRunScript("); boolean first = true; sb.append("scriptId:"); sb.append(this.scriptId); first = false; if (!first) sb.append(", "); sb.append("displayname:"); if (this.displayname == null) { sb.append("null"); } else { sb.append(this.displayname); } first = false; if (!first) sb.append(", "); sb.append("osIds:"); if (this.osIds == null) { sb.append("null"); } else { sb.append(this.osIds); } 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, 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; 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 PresetRunScriptStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public PresetRunScriptStandardScheme getScheme() { return new PresetRunScriptStandardScheme(); } } private static class PresetRunScriptStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, PresetRunScript 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: // SCRIPT_ID if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.scriptId = iprot.readI32(); struct.setScriptIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DISPLAYNAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.displayname = iprot.readString(); struct.setDisplaynameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // OS_IDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list90 = iprot.readListBegin(); struct.osIds = new java.util.ArrayList(_list90.size); int _elem91; for (int _i92 = 0; _i92 < _list90.size; ++_i92) { _elem91 = iprot.readI32(); struct.osIds.add(_elem91); } iprot.readListEnd(); } struct.setOsIdsIsSet(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, PresetRunScript struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(SCRIPT_ID_FIELD_DESC); oprot.writeI32(struct.scriptId); oprot.writeFieldEnd(); if (struct.displayname != null) { oprot.writeFieldBegin(DISPLAYNAME_FIELD_DESC); oprot.writeString(struct.displayname); oprot.writeFieldEnd(); } if (struct.osIds != null) { oprot.writeFieldBegin(OS_IDS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.osIds.size())); for (int _iter93 : struct.osIds) { oprot.writeI32(_iter93); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class PresetRunScriptTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public PresetRunScriptTupleScheme getScheme() { return new PresetRunScriptTupleScheme(); } } private static class PresetRunScriptTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, PresetRunScript struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetScriptId()) { optionals.set(0); } if (struct.isSetDisplayname()) { optionals.set(1); } if (struct.isSetOsIds()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetScriptId()) { oprot.writeI32(struct.scriptId); } if (struct.isSetDisplayname()) { oprot.writeString(struct.displayname); } if (struct.isSetOsIds()) { { oprot.writeI32(struct.osIds.size()); for (int _iter94 : struct.osIds) { oprot.writeI32(_iter94); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, PresetRunScript struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.scriptId = iprot.readI32(); struct.setScriptIdIsSet(true); } if (incoming.get(1)) { struct.displayname = iprot.readString(); struct.setDisplaynameIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list95 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32); struct.osIds = new java.util.ArrayList(_list95.size); int _elem96; for (int _i97 = 0; _i97 < _list95.size; ++_i97) { _elem96 = iprot.readI32(); struct.osIds.add(_elem96); } } struct.setOsIdsIsSet(true); } } } private static 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(); } }