diff options
Diffstat (limited to 'src/main/java/org/openslx/bwlp/thrift/iface/ImagePermissions.java')
-rw-r--r-- | src/main/java/org/openslx/bwlp/thrift/iface/ImagePermissions.java | 173 |
1 files changed, 69 insertions, 104 deletions
diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/ImagePermissions.java b/src/main/java/org/openslx/bwlp/thrift/iface/ImagePermissions.java index 57cc72e..5b0d739 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/ImagePermissions.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/ImagePermissions.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 = "2016-01-04") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.15.0)", date = "2021-12-17") public class ImagePermissions implements org.apache.thrift.TBase<ImagePermissions, ImagePermissions._Fields>, java.io.Serializable, Cloneable, Comparable<ImagePermissions> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ImagePermissions"); @@ -43,11 +16,8 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission private static final org.apache.thrift.protocol.TField EDIT_FIELD_DESC = new org.apache.thrift.protocol.TField("edit", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final org.apache.thrift.protocol.TField ADMIN_FIELD_DESC = new org.apache.thrift.protocol.TField("admin", org.apache.thrift.protocol.TType.BOOL, (short)4); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ImagePermissionsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ImagePermissionsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ImagePermissionsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ImagePermissionsTupleSchemeFactory(); public boolean link; // required public boolean download; // required @@ -61,10 +31,10 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission EDIT((short)3, "edit"), ADMIN((short)4, "admin"); - 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); } } @@ -72,6 +42,7 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission /** * 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: // LINK @@ -93,21 +64,22 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission */ 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; } @@ -116,7 +88,7 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -127,9 +99,9 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission private static final int __EDIT_ISSET_ID = 2; private static final int __ADMIN_ISSET_ID = 3; 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.LINK, new org.apache.thrift.meta_data.FieldMetaData("link", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.DOWNLOAD, new org.apache.thrift.meta_data.FieldMetaData("download", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -138,7 +110,7 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.ADMIN, new org.apache.thrift.meta_data.FieldMetaData("admin", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ImagePermissions.class, metaDataMap); } @@ -200,16 +172,16 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission } public void unsetLink() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LINK_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __LINK_ISSET_ID); } /** Returns true if field link is set (has been assigned a value) and false otherwise */ public boolean isSetLink() { - return EncodingUtils.testBit(__isset_bitfield, __LINK_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __LINK_ISSET_ID); } public void setLinkIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LINK_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __LINK_ISSET_ID, value); } public boolean isDownload() { @@ -223,16 +195,16 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission } public void unsetDownload() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DOWNLOAD_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DOWNLOAD_ISSET_ID); } /** Returns true if field download is set (has been assigned a value) and false otherwise */ public boolean isSetDownload() { - return EncodingUtils.testBit(__isset_bitfield, __DOWNLOAD_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DOWNLOAD_ISSET_ID); } public void setDownloadIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DOWNLOAD_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DOWNLOAD_ISSET_ID, value); } public boolean isEdit() { @@ -246,16 +218,16 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission } public void unsetEdit() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EDIT_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EDIT_ISSET_ID); } /** Returns true if field edit is set (has been assigned a value) and false otherwise */ public boolean isSetEdit() { - return EncodingUtils.testBit(__isset_bitfield, __EDIT_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EDIT_ISSET_ID); } public void setEditIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EDIT_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EDIT_ISSET_ID, value); } public boolean isAdmin() { @@ -269,25 +241,25 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission } public void unsetAdmin() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ADMIN_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ADMIN_ISSET_ID); } /** Returns true if field admin is set (has been assigned a value) and false otherwise */ public boolean isSetAdmin() { - return EncodingUtils.testBit(__isset_bitfield, __ADMIN_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ADMIN_ISSET_ID); } public void setAdminIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ADMIN_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ADMIN_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case LINK: if (value == null) { unsetLink(); } else { - setLink((Boolean)value); + setLink((java.lang.Boolean)value); } break; @@ -295,7 +267,7 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission if (value == null) { unsetDownload(); } else { - setDownload((Boolean)value); + setDownload((java.lang.Boolean)value); } break; @@ -303,7 +275,7 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission if (value == null) { unsetEdit(); } else { - setEdit((Boolean)value); + setEdit((java.lang.Boolean)value); } break; @@ -311,14 +283,15 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission if (value == null) { unsetAdmin(); } else { - setAdmin((Boolean)value); + setAdmin((java.lang.Boolean)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case LINK: return isLink(); @@ -333,13 +306,13 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission return isAdmin(); } - 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) { @@ -352,13 +325,11 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission case ADMIN: return isSetAdmin(); } - 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 ImagePermissions) return this.equals((ImagePermissions)that); return false; @@ -367,6 +338,8 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission public boolean equals(ImagePermissions that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_link = true; boolean that_present_link = true; @@ -409,29 +382,17 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_link = true; - list.add(present_link); - if (present_link) - list.add(link); + hashCode = hashCode * 8191 + ((link) ? 131071 : 524287); - boolean present_download = true; - list.add(present_download); - if (present_download) - list.add(download); + hashCode = hashCode * 8191 + ((download) ? 131071 : 524287); - boolean present_edit = true; - list.add(present_edit); - if (present_edit) - list.add(edit); + hashCode = hashCode * 8191 + ((edit) ? 131071 : 524287); - boolean present_admin = true; - list.add(present_admin); - if (present_admin) - list.add(admin); + hashCode = hashCode * 8191 + ((admin) ? 131071 : 524287); - return list.hashCode(); + return hashCode; } @Override @@ -442,7 +403,7 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetLink()).compareTo(other.isSetLink()); + lastComparison = java.lang.Boolean.compare(isSetLink(), other.isSetLink()); if (lastComparison != 0) { return lastComparison; } @@ -452,7 +413,7 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission return lastComparison; } } - lastComparison = Boolean.valueOf(isSetDownload()).compareTo(other.isSetDownload()); + lastComparison = java.lang.Boolean.compare(isSetDownload(), other.isSetDownload()); if (lastComparison != 0) { return lastComparison; } @@ -462,7 +423,7 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission return lastComparison; } } - lastComparison = Boolean.valueOf(isSetEdit()).compareTo(other.isSetEdit()); + lastComparison = java.lang.Boolean.compare(isSetEdit(), other.isSetEdit()); if (lastComparison != 0) { return lastComparison; } @@ -472,7 +433,7 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission return lastComparison; } } - lastComparison = Boolean.valueOf(isSetAdmin()).compareTo(other.isSetAdmin()); + lastComparison = java.lang.Boolean.compare(isSetAdmin(), other.isSetAdmin()); if (lastComparison != 0) { return lastComparison; } @@ -485,21 +446,22 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission 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("ImagePermissions("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ImagePermissions("); boolean first = true; sb.append("link:"); @@ -534,7 +496,7 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission } } - 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; @@ -544,13 +506,13 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission } } - private static class ImagePermissionsStandardSchemeFactory implements SchemeFactory { + private static class ImagePermissionsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ImagePermissionsStandardScheme getScheme() { return new ImagePermissionsStandardScheme(); } } - private static class ImagePermissionsStandardScheme extends StandardScheme<ImagePermissions> { + private static class ImagePermissionsStandardScheme extends org.apache.thrift.scheme.StandardScheme<ImagePermissions> { public void read(org.apache.thrift.protocol.TProtocol iprot, ImagePermissions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -627,18 +589,18 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission } - private static class ImagePermissionsTupleSchemeFactory implements SchemeFactory { + private static class ImagePermissionsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ImagePermissionsTupleScheme getScheme() { return new ImagePermissionsTupleScheme(); } } - private static class ImagePermissionsTupleScheme extends TupleScheme<ImagePermissions> { + private static class ImagePermissionsTupleScheme extends org.apache.thrift.scheme.TupleScheme<ImagePermissions> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ImagePermissions 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.isSetLink()) { optionals.set(0); } @@ -668,8 +630,8 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission @Override public void read(org.apache.thrift.protocol.TProtocol prot, ImagePermissions struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.link = iprot.readBool(); struct.setLinkIsSet(true); @@ -689,5 +651,8 @@ public class ImagePermissions implements org.apache.thrift.TBase<ImagePermission } } + 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(); + } } |