@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.devtools.cloudtrace.v2.TruncatableString)) { return super.equals(obj); } com.google.devtools.cloudtrace.v2.TruncatableString other = (com.google.devtools.cloudtrace.v2.TruncatableString) obj; boolean result = true; result = result && getValue().equals(other.getValue()); result = result && (getTruncatedByteCount() == other.getTruncatedByteCount()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); hash = (37 * hash) + TRUNCATED_BYTE_COUNT_FIELD_NUMBER; hash = (53 * hash) + getTruncatedByteCount(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The shortened string. For example, if the original string is 500 * bytes long and the limit of the string is 128 bytes, then * `value` contains the first 128 bytes of the 500-byte string. * Truncation always happens on a UTF8 character boundary. If there * are multi-byte characters in the string, then the length of the * shortened string might be less than the size limit. * </pre> * * <code>string value = 1;</code> */ public Builder clearValue() { value_ = getDefaultInstance().getValue(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.devtools.cloudtrace.v2.TruncatableString other) { if (other == com.google.devtools.cloudtrace.v2.TruncatableString.getDefaultInstance()) return this; if (!other.getValue().isEmpty()) { value_ = other.value_; onChanged(); } if (other.getTruncatedByteCount() != 0) { setTruncatedByteCount(other.getTruncatedByteCount()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.devtools.cloudtrace.v2.TruncatableString)) { return super.equals(obj); } com.google.devtools.cloudtrace.v2.TruncatableString other = (com.google.devtools.cloudtrace.v2.TruncatableString) obj; boolean result = true; result = result && getValue().equals(other.getValue()); result = result && (getTruncatedByteCount() == other.getTruncatedByteCount()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); hash = (37 * hash) + TRUNCATED_BYTE_COUNT_FIELD_NUMBER; hash = (53 * hash) + getTruncatedByteCount(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The shortened string. For example, if the original string is 500 * bytes long and the limit of the string is 128 bytes, then * `value` contains the first 128 bytes of the 500-byte string. * Truncation always happens on a UTF8 character boundary. If there * are multi-byte characters in the string, then the length of the * shortened string might be less than the size limit. * </pre> * * <code>string value = 1;</code> */ public Builder clearValue() { value_ = getDefaultInstance().getValue(); onChanged(); return this; } /**
public Builder mergeFrom(com.google.devtools.cloudtrace.v2.TruncatableString other) { if (other == com.google.devtools.cloudtrace.v2.TruncatableString.getDefaultInstance()) return this; if (!other.getValue().isEmpty()) { value_ = other.value_; onChanged(); } if (other.getTruncatedByteCount() != 0) { setTruncatedByteCount(other.getTruncatedByteCount()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test public void generateSpanName_ForServer() { SpanData spanData = SpanData.create( spanContext, parentSpanId, /* hasRemoteParent= */ true, SPAN_NAME, Kind.SERVER, startTimestamp, attributes, annotations, messageEvents, links, CHILD_SPAN_COUNT, status, endTimestamp); assertThat( handler .generateSpan( spanData, EMPTY_RESOURCE_LABELS, Collections.<String, AttributeValue>emptyMap()) .getDisplayName() .getValue()) .isEqualTo("Recv." + SPAN_NAME); }
@Test public void generateSpanName_ForClientWithSent() { SpanData spanData = SpanData.create( spanContext, parentSpanId, /* hasRemoteParent= */ true, "Sent." + SPAN_NAME, Kind.CLIENT, startTimestamp, attributes, annotations, messageEvents, links, CHILD_SPAN_COUNT, status, endTimestamp); assertThat( handler .generateSpan( spanData, EMPTY_RESOURCE_LABELS, Collections.<String, AttributeValue>emptyMap()) .getDisplayName() .getValue()) .isEqualTo("Sent." + SPAN_NAME); }
@Test public void generateSpanName_ForServerWithRecv() { SpanData spanData = SpanData.create( spanContext, parentSpanId, /* hasRemoteParent= */ true, "Recv." + SPAN_NAME, Kind.SERVER, startTimestamp, attributes, annotations, messageEvents, links, CHILD_SPAN_COUNT, status, endTimestamp); assertThat( handler .generateSpan( spanData, EMPTY_RESOURCE_LABELS, Collections.<String, AttributeValue>emptyMap()) .getDisplayName() .getValue()) .isEqualTo("Recv." + SPAN_NAME); }
@Test public void generateSpanName_ForClient() { SpanData spanData = SpanData.create( spanContext, parentSpanId, /* hasRemoteParent= */ true, SPAN_NAME, Kind.CLIENT, startTimestamp, attributes, annotations, messageEvents, links, CHILD_SPAN_COUNT, status, endTimestamp); assertThat( handler .generateSpan( spanData, EMPTY_RESOURCE_LABELS, Collections.<String, AttributeValue>emptyMap()) .getDisplayName() .getValue()) .isEqualTo("Sent." + SPAN_NAME); }