use of com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue in project pinpoint by naver.
the class GrpcAnnotationValueMapper method newLongIntIntByteByteStringValue.
public PLongIntIntByteByteStringValue newLongIntIntByteByteStringValue(LongIntIntByteByteStringValue v) {
final PLongIntIntByteByteStringValue.Builder builder = this.longIntIntByteByteStringBuilder;
builder.setLongValue(v.getLongValue());
builder.setIntValue1(v.getIntValue1());
if (v.getIntValue2() != -1) {
builder.setIntValue2(v.getIntValue2());
}
if (v.getByteValue1() != -1) {
builder.setByteValue1(v.getByteValue1());
}
if (v.getByteValue2() != -1) {
builder.setByteValue2(v.getByteValue2());
}
if (v.getStringValue() != null) {
StringValue stringValue = newStringValue(v.getStringValue());
builder.setStringValue(stringValue);
}
PLongIntIntByteByteStringValue value = builder.build();
builder.clear();
return value;
}
use of com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue 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.PLongIntIntByteByteStringValue in project pinpoint by naver.
the class GrpcAnnotationValueMapperTest method buildPAnnotationValue_LongIntIntByteByteStringValue.
@Test
public void buildPAnnotationValue_LongIntIntByteByteStringValue() {
LongIntIntByteByteStringValue intStringValue = new LongIntIntByteByteStringValue(1L, 2, 3, (byte) 4, (byte) 5, "6");
PAnnotationValue container = mapper.buildPAnnotationValue(Annotations.of(1, intStringValue));
PLongIntIntByteByteStringValue pAnnotation = container.getLongIntIntByteByteStringValue();
Assert.assertEquals(pAnnotation.getLongValue(), 1);
Assert.assertEquals(pAnnotation.getIntValue1(), 2);
Assert.assertEquals(pAnnotation.getIntValue2(), 3);
Assert.assertEquals(pAnnotation.getByteValue1(), 4);
Assert.assertEquals(pAnnotation.getByteValue2(), 5);
Assert.assertEquals(pAnnotation.getStringValue().getValue(), "6");
}
use of com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue in project pinpoint by naver.
the class GrpcAnnotationHandler method newLongIntIntByteByteStringValue.
private LongIntIntByteByteStringValue newLongIntIntByteByteStringValue(Object annotationValue) {
final PLongIntIntByteByteStringValue pValue = (PLongIntIntByteByteStringValue) annotationValue;
String stringValue = null;
if (pValue.hasStringValue()) {
stringValue = pValue.getStringValue().getValue();
}
return new LongIntIntByteByteStringValue(pValue.getLongValue(), pValue.getIntValue1(), pValue.getIntValue2(), (byte) pValue.getByteValue1(), (byte) pValue.getByteValue2(), stringValue);
}
Aggregations