From 746af5d07d2b7745618eb75ef3757d150ab02042 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Fri, 17 Dec 2021 17:03:51 +0100 Subject: Update generated Thrift API to version 0.15.0 --- .../bwlp/thrift/iface/TransferInformation.java | 245 +++++++++------------ 1 file changed, 110 insertions(+), 135 deletions(-) (limited to 'src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java') diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java b/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java index 40d5680..692d3df 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.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 = "2017-09-06") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.15.0)", date = "2021-12-17") public class TransferInformation 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("TransferInformation"); @@ -44,17 +17,14 @@ public class TransferInformation implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TransferInformationStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TransferInformationTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TransferInformationStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TransferInformationTupleSchemeFactory(); - public String token; // required + public @org.apache.thrift.annotation.Nullable java.lang.String token; // required public int plainPort; // required public int sslPort; // required - public List blockHashes; // optional - public ByteBuffer machineDescription; // optional + public @org.apache.thrift.annotation.Nullable java.util.List blockHashes; // optional + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer machineDescription; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -64,10 +34,10 @@ public class TransferInformation implements org.apache.thrift.TBase byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -75,6 +45,7 @@ public class TransferInformation implements org.apache.thrift.TBase 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.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Token"))); tmpMap.put(_Fields.PLAIN_PORT, new org.apache.thrift.meta_data.FieldMetaData("plainPort", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -145,7 +117,7 @@ public class TransferInformation implements org.apache.thrift.TBase __this__blockHashes = new ArrayList(other.blockHashes); + java.util.List __this__blockHashes = new java.util.ArrayList(other.blockHashes); this.blockHashes = __this__blockHashes; } if (other.isSetMachineDescription()) { @@ -199,11 +171,12 @@ public class TransferInformation implements org.apache.thrift.TBase getBlockHashesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getBlockHashesIterator() { return (this.blockHashes == null) ? null : this.blockHashes.iterator(); } - public void addToBlockHashes(ByteBuffer elem) { + public void addToBlockHashes(java.nio.ByteBuffer elem) { if (this.blockHashes == null) { - this.blockHashes = new ArrayList(); + this.blockHashes = new java.util.ArrayList(); } this.blockHashes.add(elem); } - public List getBlockHashes() { + @org.apache.thrift.annotation.Nullable + public java.util.List getBlockHashes() { return this.blockHashes; } - public TransferInformation setBlockHashes(List blockHashes) { + public TransferInformation setBlockHashes(@org.apache.thrift.annotation.Nullable java.util.List blockHashes) { this.blockHashes = blockHashes; return this; } @@ -313,16 +288,16 @@ public class TransferInformation implements org.apache.thrift.TBase)value); + setBlockHashes((java.util.List)value); } break; @@ -380,14 +355,19 @@ public class TransferInformation implements org.apache.thrift.TBase list = new ArrayList(); + int hashCode = 1; - boolean present_token = true && (isSetToken()); - list.add(present_token); - if (present_token) - list.add(token); + hashCode = hashCode * 8191 + ((isSetToken()) ? 131071 : 524287); + if (isSetToken()) + hashCode = hashCode * 8191 + token.hashCode(); - boolean present_plainPort = true; - list.add(present_plainPort); - if (present_plainPort) - list.add(plainPort); + hashCode = hashCode * 8191 + plainPort; - boolean present_sslPort = true; - list.add(present_sslPort); - if (present_sslPort) - list.add(sslPort); + hashCode = hashCode * 8191 + sslPort; - boolean present_blockHashes = true && (isSetBlockHashes()); - list.add(present_blockHashes); - if (present_blockHashes) - list.add(blockHashes); + hashCode = hashCode * 8191 + ((isSetBlockHashes()) ? 131071 : 524287); + if (isSetBlockHashes()) + hashCode = hashCode * 8191 + blockHashes.hashCode(); - boolean present_machineDescription = true && (isSetMachineDescription()); - list.add(present_machineDescription); - if (present_machineDescription) - list.add(machineDescription); + hashCode = hashCode * 8191 + ((isSetMachineDescription()) ? 131071 : 524287); + if (isSetMachineDescription()) + hashCode = hashCode * 8191 + machineDescription.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -530,7 +501,7 @@ public class TransferInformation implements org.apache.thrift.TBase { + private static class TransferInformationStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TransferInformation struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -707,13 +679,13 @@ public class TransferInformation implements org.apache.thrift.TBase(_list178.size); - ByteBuffer _elem179; - for (int _i180 = 0; _i180 < _list178.size; ++_i180) + org.apache.thrift.protocol.TList _list290 = iprot.readListBegin(); + struct.blockHashes = new java.util.ArrayList(_list290.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem291; + for (int _i292 = 0; _i292 < _list290.size; ++_i292) { - _elem179 = iprot.readBinary(); - struct.blockHashes.add(_elem179); + _elem291 = iprot.readBinary(); + struct.blockHashes.add(_elem291); } iprot.readListEnd(); } @@ -761,9 +733,9 @@ public class TransferInformation implements org.apache.thrift.TBase { + private static class TransferInformationTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TransferInformation 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.isSetToken()) { optionals.set(0); } @@ -823,9 +795,9 @@ public class TransferInformation implements org.apache.thrift.TBase(_list183.size); - ByteBuffer _elem184; - for (int _i185 = 0; _i185 < _list183.size; ++_i185) + org.apache.thrift.protocol.TList _list295 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); + struct.blockHashes = new java.util.ArrayList(_list295.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem296; + for (int _i297 = 0; _i297 < _list295.size; ++_i297) { - _elem184 = iprot.readBinary(); - struct.blockHashes.add(_elem184); + _elem296 = iprot.readBinary(); + struct.blockHashes.add(_elem296); } } struct.setBlockHashesIsSet(true); @@ -870,5 +842,8 @@ public class TransferInformation implements org.apache.thrift.TBase 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(); + } } -- cgit v1.2.3-55-g7522