com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder>( (com.google.devtools.cloudtrace.v2.TruncatableString) value_, getParentForChildren(), isClean()); value_ = null; onChanged();
.containsEntry(ATTRIBUTE_KEY_1, AttributeValue.newBuilder().setIntValue(10L).build()); assertThat(span.getAttributes().getAttributeMapMap()) .containsEntry(ATTRIBUTE_KEY_2, AttributeValue.newBuilder().setBoolValue(true).build());
.containsEntry("/http/user_agent", toStringAttributeValueProto("user_agent")); assertThat(attributes) .containsEntry("/http/status_code", AttributeValue.newBuilder().setIntValue(200L).build());
com.google.devtools.cloudtrace.v2.TruncatableStringOrBuilder>( (com.google.devtools.cloudtrace.v2.TruncatableString) value_, getParentForChildren(), isClean()); value_ = null; onChanged();
public Builder mergeFrom(com.google.devtools.cloudtrace.v2.AttributeValue other) { if (other == com.google.devtools.cloudtrace.v2.AttributeValue.getDefaultInstance()) return this; switch (other.getValueCase()) { case STRING_VALUE: { mergeStringValue(other.getStringValue()); break; } case INT_VALUE: { setIntValue(other.getIntValue()); break; } case BOOL_VALUE: { setBoolValue(other.getBoolValue()); break; } case VALUE_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
toStringAttributeValueProto("my-project"), createResourceLabelKey(AWS_EC2_INSTANCE, "long_attr"), AttributeValue.newBuilder().setIntValue(1234).build(), createResourceLabelKey(AWS_EC2_INSTANCE, "bool_attr"), AttributeValue.newBuilder().setBoolValue(true).build());
@VisibleForTesting static AttributeValue toStringAttributeValueProto(String value) { return AttributeValue.newBuilder().setStringValue(toTruncatableStringProto(value)).build(); }
@java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
@Override public AttributeValue apply(Long longValue) { return AttributeValue.newBuilder().setIntValue(longValue).build(); } };
@Override public AttributeValue apply(Boolean booleanValue) { return AttributeValue.newBuilder().setBoolValue(booleanValue).build(); } };
@java.lang.Override public com.google.devtools.cloudtrace.v2.AttributeValue build() { com.google.devtools.cloudtrace.v2.AttributeValue result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
static AttributeValue toAttributeValue(String text) { return AttributeValue.newBuilder() .setStringValue(toTruncatableString(text)) .build(); }
@Override public AttributeValue apply(Long longValue) { return AttributeValue.newBuilder().setIntValue(longValue).build(); } };
@Override public AttributeValue apply(String stringValue) { return AttributeValue.newBuilder() .setStringValue(toTruncatableStringProto(stringValue)) .build(); } };
@VisibleForTesting static AttributeValue toStringAttributeValueProto(String value) { return AttributeValue.newBuilder().setStringValue(toTruncatableStringProto(value)).build(); }
@Override public AttributeValue apply(Double doubleValue) { AttributeValue.Builder attributeValueBuilder = AttributeValue.newBuilder(); // TODO: set double value if Stackdriver Trace support it in the future. attributeValueBuilder.setStringValue( toTruncatableStringProto(String.valueOf(doubleValue))); return attributeValueBuilder.build(); } };
@Override public AttributeValue apply(Boolean booleanValue) { return AttributeValue.newBuilder().setBoolValue(booleanValue).build(); } };
@Override public AttributeValue apply(String stringValue) { return AttributeValue.newBuilder() .setStringValue(toTruncatableStringProto(stringValue)) .build(); } };
@Override public AttributeValue apply(Double doubleValue) { AttributeValue.Builder attributeValueBuilder = AttributeValue.newBuilder(); // TODO: set double value if Stackdriver Trace support it in the future. attributeValueBuilder.setStringValue( toTruncatableStringProto(String.valueOf(doubleValue))); return attributeValueBuilder.build(); } };