use of com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue 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.PIntBooleanIntBooleanValue in project pinpoint by naver.
the class GrpcAnnotationValueMapperTest method buildPAnnotationValue_IntBooleanIntBooleanValue.
@Test
public void buildPAnnotationValue_IntBooleanIntBooleanValue() {
IntBooleanIntBooleanValue intStringValue = new IntBooleanIntBooleanValue(1, true, 3, false);
PAnnotationValue container = mapper.buildPAnnotationValue(Annotations.of(1, intStringValue));
PIntBooleanIntBooleanValue pAnnotation = container.getIntBooleanIntBooleanValue();
Assert.assertEquals(pAnnotation.getIntValue1(), 1);
Assert.assertEquals(pAnnotation.getBoolValue1(), true);
Assert.assertEquals(pAnnotation.getIntValue2(), 3);
Assert.assertEquals(pAnnotation.getBoolValue2(), false);
}
use of com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue in project pinpoint by naver.
the class GrpcAnnotationValueMapper method newIntBooleanIntBooleanValue.
public PIntBooleanIntBooleanValue newIntBooleanIntBooleanValue(IntBooleanIntBooleanValue v) {
final PIntBooleanIntBooleanValue.Builder builder = this.intBoolBoolBuilder;
builder.setIntValue1(v.getIntValue1());
builder.setBoolValue1(v.isBooleanValue1());
builder.setIntValue2(v.getIntValue2());
builder.setBoolValue2(v.isBooleanValue2());
PIntBooleanIntBooleanValue value = builder.build();
builder.clear();
return value;
}
Aggregations