
io.jaegertracing.thriftjava.Process Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jaeger-thrift Show documentation
Show all versions of jaeger-thrift Show documentation
Jaeger Java bindings for OpenTracing API
The newest version!
/**
* Autogenerated by Thrift Compiler (0.12.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package io.jaegertracing.thriftjava;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2022-07-01")
public class Process 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("Process");
private static final org.apache.thrift.protocol.TField SERVICE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceName", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField TAGS_FIELD_DESC = new org.apache.thrift.protocol.TField("tags", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ProcessStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ProcessTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.lang.String serviceName; // required
public @org.apache.thrift.annotation.Nullable java.util.List tags; // 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 {
SERVICE_NAME((short)1, "serviceName"),
TAGS((short)2, "tags");
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: // SERVICE_NAME
return SERVICE_NAME;
case 2: // TAGS
return TAGS;
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 _Fields optionals[] = {_Fields.TAGS};
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.SERVICE_NAME, new org.apache.thrift.meta_data.FieldMetaData("serviceName", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TAGS, new org.apache.thrift.meta_data.FieldMetaData("tags", org.apache.thrift.TFieldRequirementType.OPTIONAL,
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, Tag.class))));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Process.class, metaDataMap);
}
public Process() {
}
public Process(
java.lang.String serviceName)
{
this();
this.serviceName = serviceName;
}
/**
* Performs a deep copy on other.
*/
public Process(Process other) {
if (other.isSetServiceName()) {
this.serviceName = other.serviceName;
}
if (other.isSetTags()) {
java.util.List __this__tags = new java.util.ArrayList(other.tags.size());
for (Tag other_element : other.tags) {
__this__tags.add(new Tag(other_element));
}
this.tags = __this__tags;
}
}
public Process deepCopy() {
return new Process(this);
}
@Override
public void clear() {
this.serviceName = null;
this.tags = null;
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getServiceName() {
return this.serviceName;
}
public Process setServiceName(@org.apache.thrift.annotation.Nullable java.lang.String serviceName) {
this.serviceName = serviceName;
return this;
}
public void unsetServiceName() {
this.serviceName = null;
}
/** Returns true if field serviceName is set (has been assigned a value) and false otherwise */
public boolean isSetServiceName() {
return this.serviceName != null;
}
public void setServiceNameIsSet(boolean value) {
if (!value) {
this.serviceName = null;
}
}
public int getTagsSize() {
return (this.tags == null) ? 0 : this.tags.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator getTagsIterator() {
return (this.tags == null) ? null : this.tags.iterator();
}
public void addToTags(Tag elem) {
if (this.tags == null) {
this.tags = new java.util.ArrayList();
}
this.tags.add(elem);
}
@org.apache.thrift.annotation.Nullable
public java.util.List getTags() {
return this.tags;
}
public Process setTags(@org.apache.thrift.annotation.Nullable java.util.List tags) {
this.tags = tags;
return this;
}
public void unsetTags() {
this.tags = null;
}
/** Returns true if field tags is set (has been assigned a value) and false otherwise */
public boolean isSetTags() {
return this.tags != null;
}
public void setTagsIsSet(boolean value) {
if (!value) {
this.tags = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SERVICE_NAME:
if (value == null) {
unsetServiceName();
} else {
setServiceName((java.lang.String)value);
}
break;
case TAGS:
if (value == null) {
unsetTags();
} else {
setTags((java.util.List)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SERVICE_NAME:
return getServiceName();
case TAGS:
return getTags();
}
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 SERVICE_NAME:
return isSetServiceName();
case TAGS:
return isSetTags();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof Process)
return this.equals((Process)that);
return false;
}
public boolean equals(Process that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_serviceName = true && this.isSetServiceName();
boolean that_present_serviceName = true && that.isSetServiceName();
if (this_present_serviceName || that_present_serviceName) {
if (!(this_present_serviceName && that_present_serviceName))
return false;
if (!this.serviceName.equals(that.serviceName))
return false;
}
boolean this_present_tags = true && this.isSetTags();
boolean that_present_tags = true && that.isSetTags();
if (this_present_tags || that_present_tags) {
if (!(this_present_tags && that_present_tags))
return false;
if (!this.tags.equals(that.tags))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetServiceName()) ? 131071 : 524287);
if (isSetServiceName())
hashCode = hashCode * 8191 + serviceName.hashCode();
hashCode = hashCode * 8191 + ((isSetTags()) ? 131071 : 524287);
if (isSetTags())
hashCode = hashCode * 8191 + tags.hashCode();
return hashCode;
}
@Override
public int compareTo(Process other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetServiceName()).compareTo(other.isSetServiceName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServiceName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceName, other.serviceName);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.valueOf(isSetTags()).compareTo(other.isSetTags());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTags()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tags, other.tags);
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("Process(");
boolean first = true;
sb.append("serviceName:");
if (this.serviceName == null) {
sb.append("null");
} else {
sb.append(this.serviceName);
}
first = false;
if (isSetTags()) {
if (!first) sb.append(", ");
sb.append("tags:");
if (this.tags == null) {
sb.append("null");
} else {
sb.append(this.tags);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (serviceName == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'serviceName' was not present! Struct: " + toString());
}
// 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 {
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 ProcessStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public ProcessStandardScheme getScheme() {
return new ProcessStandardScheme();
}
}
private static class ProcessStandardScheme extends org.apache.thrift.scheme.StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, Process 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: // SERVICE_NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.serviceName = iprot.readString();
struct.setServiceNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // TAGS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
struct.tags = new java.util.ArrayList(_list32.size);
@org.apache.thrift.annotation.Nullable Tag _elem33;
for (int _i34 = 0; _i34 < _list32.size; ++_i34)
{
_elem33 = new Tag();
_elem33.read(iprot);
struct.tags.add(_elem33);
}
iprot.readListEnd();
}
struct.setTagsIsSet(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, Process struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.serviceName != null) {
oprot.writeFieldBegin(SERVICE_NAME_FIELD_DESC);
oprot.writeString(struct.serviceName);
oprot.writeFieldEnd();
}
if (struct.tags != null) {
if (struct.isSetTags()) {
oprot.writeFieldBegin(TAGS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tags.size()));
for (Tag _iter35 : struct.tags)
{
_iter35.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ProcessTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public ProcessTupleScheme getScheme() {
return new ProcessTupleScheme();
}
}
private static class ProcessTupleScheme extends org.apache.thrift.scheme.TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Process struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.serviceName);
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetTags()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetTags()) {
{
oprot.writeI32(struct.tags.size());
for (Tag _iter36 : struct.tags)
{
_iter36.write(oprot);
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Process struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.serviceName = iprot.readString();
struct.setServiceNameIsSet(true);
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.tags = new java.util.ArrayList(_list37.size);
@org.apache.thrift.annotation.Nullable Tag _elem38;
for (int _i39 = 0; _i39 < _list37.size; ++_i39)
{
_elem38 = new Tag();
_elem38.read(iprot);
struct.tags.add(_elem38);
}
}
struct.setTagsIsSet(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();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy