use of com.navercorp.pinpoint.grpc.trace.PIntStringStringValue in project pinpoint by naver.
the class GrpcAnnotationValueMapper method newIntStringStringValue.
public PIntStringStringValue newIntStringStringValue(IntStringStringValue v) {
final PIntStringStringValue.Builder builder = this.intStringStringBuilder;
builder.setIntValue(v.getIntValue());
if (v.getStringValue1() != null) {
StringValue stringValue1 = newStringValue(v.getStringValue1());
builder.setStringValue1(stringValue1);
}
if (v.getStringValue2() != null) {
StringValue stringValue2 = newStringValue(v.getStringValue2());
builder.setStringValue2(stringValue2);
}
PIntStringStringValue value = builder.build();
builder.clear();
return value;
}
use of com.navercorp.pinpoint.grpc.trace.PIntStringStringValue in project pinpoint by naver.
the class DataTypeAnnotation method apply.
@Override
public PAnnotationValue apply(GrpcAnnotationValueMapper context) {
PAnnotationValue.Builder builder = context.getAnnotationBuilder();
final DataType dataType = this.value;
if (dataType instanceof IntStringValue) {
final IntStringValue v = (IntStringValue) dataType;
PIntStringValue pIntStringValue = context.newIntStringValue(v);
builder.setIntStringValue(pIntStringValue);
return builder.build();
} else if (dataType instanceof StringStringValue) {
final StringStringValue v = (StringStringValue) dataType;
PStringStringValue pStringStringValue = context.newStringStringValue(v);
builder.setStringStringValue(pStringStringValue);
return builder.build();
} else if (dataType instanceof IntStringStringValue) {
final IntStringStringValue v = (IntStringStringValue) dataType;
final PIntStringStringValue pIntStringStringValue = context.newIntStringStringValue(v);
builder.setIntStringStringValue(pIntStringStringValue);
return builder.build();
} else if (dataType instanceof LongIntIntByteByteStringValue) {
final LongIntIntByteByteStringValue v = (LongIntIntByteByteStringValue) dataType;
final PLongIntIntByteByteStringValue pValue = context.newLongIntIntByteByteStringValue(v);
builder.setLongIntIntByteByteStringValue(pValue);
return builder.build();
} else if (dataType instanceof IntBooleanIntBooleanValue) {
final IntBooleanIntBooleanValue v = (IntBooleanIntBooleanValue) dataType;
final PIntBooleanIntBooleanValue pValue = context.newIntBooleanIntBooleanValue(v);
builder.setIntBooleanIntBooleanValue(pValue);
return builder.build();
}
throw new UnsupportedOperationException("unsupported type:" + dataType);
}
use of com.navercorp.pinpoint.grpc.trace.PIntStringStringValue in project pinpoint by naver.
the class GrpcAnnotationValueMapperTest method buildPAnnotationValue_IntStringStringValue.
@Test
public void buildPAnnotationValue_IntStringStringValue() {
IntStringStringValue intStringValue = new IntStringStringValue(1, "2", "3");
PAnnotationValue container = mapper.buildPAnnotationValue(Annotations.of(1, intStringValue));
PIntStringStringValue pAnnotation = container.getIntStringStringValue();
Assert.assertEquals(pAnnotation.getIntValue(), 1);
Assert.assertEquals(pAnnotation.getStringValue1().getValue(), "2");
Assert.assertEquals(pAnnotation.getStringValue2().getValue(), "3");
}
use of com.navercorp.pinpoint.grpc.trace.PIntStringStringValue in project pinpoint by naver.
the class GrpcAnnotationHandler method newIntStringString.
private IntStringStringValue newIntStringString(Object annotationValue) {
final PIntStringStringValue pValue = (PIntStringStringValue) annotationValue;
String stringValue1 = null;
if (pValue.hasStringValue1()) {
stringValue1 = pValue.getStringValue1().getValue();
}
String stringValue2 = null;
if (pValue.hasStringValue2()) {
stringValue2 = pValue.getStringValue2().getValue();
}
return new IntStringStringValue(pValue.getIntValue(), stringValue1, stringValue2);
}
Aggregations