@java.lang.Override public com.google.devtools.cloudtrace.v2.Span.Link buildPartial() { com.google.devtools.cloudtrace.v2.Span.Link result = new com.google.devtools.cloudtrace.v2.Span.Link(this); result.traceId_ = traceId_; result.spanId_ = spanId_; result.type_ = type_; if (attributesBuilder_ == null) { result.attributes_ = attributes_; } else { result.attributes_ = attributesBuilder_.build(); } onBuilt(); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TRACE_ID_FIELD_NUMBER; hash = (53 * hash) + getTraceId().hashCode(); hash = (37 * hash) + SPAN_ID_FIELD_NUMBER; hash = (53 * hash) + getSpanId().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; if (hasAttributes()) { hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; hash = (53 * hash) + getAttributes().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(com.google.devtools.cloudtrace.v2.Span.Link other) { if (other == com.google.devtools.cloudtrace.v2.Span.Link.getDefaultInstance()) return this; if (!other.getTraceId().isEmpty()) { traceId_ = other.traceId_; onChanged(); } if (!other.getSpanId().isEmpty()) { spanId_ = other.spanId_; onChanged(); } if (other.type_ != 0) { setTypeValue(other.getTypeValue()); } if (other.hasAttributes()) { mergeAttributes(other.getAttributes()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
.setDroppedLinksCount(DROPPED_LINKS_COUNT) .addLink( Span.Link.newBuilder() .setType(Span.Link.Type.CHILD_LINKED_SPAN) .setTraceId(TRACE_ID)
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.devtools.cloudtrace.v2.Span.Link)) { return super.equals(obj); } com.google.devtools.cloudtrace.v2.Span.Link other = (com.google.devtools.cloudtrace.v2.Span.Link) obj; boolean result = true; result = result && getTraceId().equals(other.getTraceId()); result = result && getSpanId().equals(other.getSpanId()); result = result && type_ == other.type_; result = result && (hasAttributes() == other.hasAttributes()); if (hasAttributes()) { result = result && getAttributes().equals(other.getAttributes()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getTraceIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, traceId_); } if (!getSpanIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, spanId_); } if (type_ != com.google.devtools.cloudtrace.v2.Span.Link.Type.TYPE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, type_); } if (attributes_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAttributes()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TRACE_ID_FIELD_NUMBER; hash = (53 * hash) + getTraceId().hashCode(); hash = (37 * hash) + SPAN_ID_FIELD_NUMBER; hash = (53 * hash) + getSpanId().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; if (hasAttributes()) { hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; hash = (53 * hash) + getAttributes().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(com.google.devtools.cloudtrace.v2.Span.Link other) { if (other == com.google.devtools.cloudtrace.v2.Span.Link.getDefaultInstance()) return this; if (!other.getTraceId().isEmpty()) { traceId_ = other.traceId_; onChanged(); } if (!other.getSpanId().isEmpty()) { spanId_ = other.spanId_; onChanged(); } if (other.type_ != 0) { setTypeValue(other.getTypeValue()); } if (other.hasAttributes()) { mergeAttributes(other.getAttributes()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * * * <pre> * The [TRACE_ID] for a trace within a project. * </pre> * * <code>string trace_id = 1;</code> */ public Builder clearTraceId() { traceId_ = getDefaultInstance().getTraceId(); onChanged(); return this; } /**
/** * * * <pre> * The [SPAN_ID] for a span within a trace. * </pre> * * <code>string span_id = 2;</code> */ public Builder clearSpanId() { spanId_ = getDefaultInstance().getSpanId(); onChanged(); return this; } /**
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getTraceIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, traceId_); } if (!getSpanIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, spanId_); } if (type_ != com.google.devtools.cloudtrace.v2.Span.Link.Type.TYPE_UNSPECIFIED.getNumber()) { output.writeEnum(3, type_); } if (attributes_ != null) { output.writeMessage(4, getAttributes()); } unknownFields.writeTo(output); }
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.devtools.cloudtrace.v2.Span.Link.getDescriptor().getEnumTypes().get(0); }
@java.lang.Override public com.google.devtools.cloudtrace.v2.Span.Link buildPartial() { com.google.devtools.cloudtrace.v2.Span.Link result = new com.google.devtools.cloudtrace.v2.Span.Link(this); result.traceId_ = traceId_; result.spanId_ = spanId_; result.type_ = type_; if (attributesBuilder_ == null) { result.attributes_ = attributes_; } else { result.attributes_ = attributesBuilder_.build(); } onBuilt(); return result; }
/** * * * <pre> * A collection of links. * </pre> * * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code> */ public com.google.devtools.cloudtrace.v2.Span.Link.Builder addLinkBuilder() { return getLinkFieldBuilder() .addBuilder(com.google.devtools.cloudtrace.v2.Span.Link.getDefaultInstance()); } /**
/** * * * <pre> * A collection of links. * </pre> * * <code>repeated .google.devtools.cloudtrace.v2.Span.Link link = 1;</code> */ public com.google.devtools.cloudtrace.v2.Span.Link.Builder addLinkBuilder(int index) { return getLinkFieldBuilder() .addBuilder(index, com.google.devtools.cloudtrace.v2.Span.Link.getDefaultInstance()); } /**
/** * * * <pre> * A set of attributes on the link. You have have up to 32 attributes per * link. * </pre> * * <code>.google.devtools.cloudtrace.v2.Span.Attributes attributes = 4;</code> */ public com.google.devtools.cloudtrace.v2.Span.AttributesOrBuilder getAttributesOrBuilder() { return getAttributes(); }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.devtools.cloudtrace.v2.Span.Link getDefaultInstanceForType() { return com.google.devtools.cloudtrace.v2.Span.Link.getDefaultInstance(); }
private static Link toLinkProto(io.opencensus.trace.Link link) { checkNotNull(link); return Link.newBuilder() .setTraceId(link.getTraceId().toLowerBase16()) .setSpanId(link.getSpanId().toLowerBase16()) .setType(toLinkTypeProto(link.getType())) .setAttributes(toAttributesBuilderProto(link.getAttributes(), 0)) .build(); }
private static Link toLinkProto(io.opencensus.trace.Link link) { checkNotNull(link); return Link.newBuilder() .setTraceId(link.getTraceId().toLowerBase16()) .setSpanId(link.getSpanId().toLowerBase16()) .setType(toLinkTypeProto(link.getType())) .setAttributes(toAttributesBuilderProto(link.getAttributes(), 0)) .build(); }