@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof BinaryAnnotation) { BinaryAnnotation that = (BinaryAnnotation) o; return (this.key.equals(that.key)) && (Arrays.equals(this.value, that.value)) && (this.type.equals(that.type)) && equal(this.host, that.host); } return false; }
public void write(org.apache.thrift.protocol.TProtocol oprot, BinaryAnnotation struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(struct.key); oprot.writeFieldEnd(); } if (struct.value != null) { oprot.writeFieldBegin(VALUE_FIELD_DESC); oprot.writeBinary(struct.value); oprot.writeFieldEnd(); } if (struct.annotation_type != null) { oprot.writeFieldBegin(ANNOTATION_TYPE_FIELD_DESC); oprot.writeI32(struct.annotation_type.getValue()); oprot.writeFieldEnd(); } if (struct.host != null) { if (struct.isSetHost()) { oprot.writeFieldBegin(HOST_FIELD_DESC); struct.host.write(oprot); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= key.hashCode(); h *= 1000003; h ^= Arrays.hashCode(value); h *= 1000003; h ^= type.hashCode(); h *= 1000003; h ^= (host == null) ? 0 : host.hashCode(); return h; } }
case 3: // ANNOTATION_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.annotation_type = AnnotationType.findByValue(iprot.readI32()); struct.setAnnotation_typeIsSet(true); } else {
@Override public Span readSpan(byte[] bytes) { zipkin.Span in = codec.readSpan(bytes); Span result = new Span(); result.setTrace_id(in.traceId); result.setId(in.id); result.setParent_id(in.parentId); result.setName(in.name); result.setTimestamp(in.timestamp); result.setDuration(in.duration); result.setDebug(in.debug); for (zipkin.Annotation a : in.annotations) { result.addToAnnotations(Annotation.create( a.timestamp, a.value, to(a.endpoint))); } for (zipkin.BinaryAnnotation a : in.binaryAnnotations) { result.addToBinary_annotations(BinaryAnnotation.create( a.key, a.value, AnnotationType.fromValue(a.type.value), to(a.endpoint))); } return result; }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, BinaryAnnotation struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } if (incoming.get(1)) { struct.value = iprot.readBinary(); struct.setValueIsSet(true); } if (incoming.get(2)) { struct.annotation_type = AnnotationType.findByValue(iprot.readI32()); struct.setAnnotation_typeIsSet(true); } if (incoming.get(3)) { struct.host = new Endpoint(); struct.host.read(iprot); struct.setHostIsSet(true); } } }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof BinaryAnnotation) { BinaryAnnotation that = (BinaryAnnotation) o; return (this.key.equals(that.key)) && (Arrays.equals(this.value, that.value)) && (this.type.equals(that.type)) && equal(this.host, that.host); } return false; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, BinaryAnnotation struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetKey()) { optionals.set(0); } if (struct.isSetValue()) { optionals.set(1); } if (struct.isSetAnnotation_type()) { optionals.set(2); } if (struct.isSetHost()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetKey()) { oprot.writeString(struct.key); } if (struct.isSetValue()) { oprot.writeBinary(struct.value); } if (struct.isSetAnnotation_type()) { oprot.writeI32(struct.annotation_type.getValue()); } if (struct.isSetHost()) { struct.host.write(oprot); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, BinaryAnnotation struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } if (incoming.get(1)) { struct.value = iprot.readBinary(); struct.setValueIsSet(true); } if (incoming.get(2)) { struct.annotation_type = AnnotationType.findByValue(iprot.readI32()); struct.setAnnotation_typeIsSet(true); } if (incoming.get(3)) { struct.host = new Endpoint(); struct.host.read(iprot); struct.setHostIsSet(true); } } }
@Override public int hashCode() { int h = 1; h *= 1000003; h ^= key.hashCode(); h *= 1000003; h ^= Arrays.hashCode(value); h *= 1000003; h ^= type.hashCode(); h *= 1000003; h ^= (host == null) ? 0 : host.hashCode(); return h; } }
if (!(this_present_annotation_type && that_present_annotation_type)) return false; if (!this.annotation_type.equals(that.annotation_type)) return false;
@Override public void write(org.apache.thrift.protocol.TProtocol prot, BinaryAnnotation struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetKey()) { optionals.set(0); } if (struct.isSetValue()) { optionals.set(1); } if (struct.isSetAnnotation_type()) { optionals.set(2); } if (struct.isSetHost()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetKey()) { oprot.writeString(struct.key); } if (struct.isSetValue()) { oprot.writeBinary(struct.value); } if (struct.isSetAnnotation_type()) { oprot.writeI32(struct.annotation_type.getValue()); } if (struct.isSetHost()) { struct.host.write(oprot); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, BinaryAnnotation struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } if (incoming.get(1)) { struct.value = iprot.readBinary(); struct.setValueIsSet(true); } if (incoming.get(2)) { struct.annotation_type = AnnotationType.findByValue(iprot.readI32()); struct.setAnnotation_typeIsSet(true); } if (incoming.get(3)) { struct.host = new Endpoint(); struct.host.read(iprot); struct.setHostIsSet(true); } } }
if (!(this_present_annotation_type && that_present_annotation_type)) return false; if (!this.annotation_type.equals(that.annotation_type)) return false;
@Override public void write(org.apache.thrift.protocol.TProtocol prot, BinaryAnnotation struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetKey()) { optionals.set(0); } if (struct.isSetValue()) { optionals.set(1); } if (struct.isSetAnnotation_type()) { optionals.set(2); } if (struct.isSetHost()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetKey()) { oprot.writeString(struct.key); } if (struct.isSetValue()) { oprot.writeBinary(struct.value); } if (struct.isSetAnnotation_type()) { oprot.writeI32(struct.annotation_type.getValue()); } if (struct.isSetHost()) { struct.host.write(oprot); } }
case 3: // ANNOTATION_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.annotation_type = AnnotationType.findByValue(iprot.readI32()); struct.setAnnotation_typeIsSet(true); } else {
if (!(this_present_annotation_type && that_present_annotation_type)) return false; if (!this.annotation_type.equals(that.annotation_type)) return false;
public void write(org.apache.thrift.protocol.TProtocol oprot, BinaryAnnotation struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(struct.key); oprot.writeFieldEnd(); } if (struct.value != null) { oprot.writeFieldBegin(VALUE_FIELD_DESC); oprot.writeBinary(struct.value); oprot.writeFieldEnd(); } if (struct.annotation_type != null) { oprot.writeFieldBegin(ANNOTATION_TYPE_FIELD_DESC); oprot.writeI32(struct.annotation_type.getValue()); oprot.writeFieldEnd(); } if (struct.host != null) { if (struct.isSetHost()) { oprot.writeFieldBegin(HOST_FIELD_DESC); struct.host.write(oprot); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
case 3: // ANNOTATION_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.annotation_type = AnnotationType.findByValue(iprot.readI32()); struct.setAnnotation_typeIsSet(true); } else {
public void write(org.apache.thrift.protocol.TProtocol oprot, BinaryAnnotation struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(struct.key); oprot.writeFieldEnd(); } if (struct.value != null) { oprot.writeFieldBegin(VALUE_FIELD_DESC); oprot.writeBinary(struct.value); oprot.writeFieldEnd(); } if (struct.annotation_type != null) { oprot.writeFieldBegin(ANNOTATION_TYPE_FIELD_DESC); oprot.writeI32(struct.annotation_type.getValue()); oprot.writeFieldEnd(); } if (struct.host != null) { if (struct.isSetHost()) { oprot.writeFieldBegin(HOST_FIELD_DESC); struct.host.write(oprot); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }