Search in sources :

Example 1 with PIntBooleanIntBooleanValue

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);
}
Also used : PAnnotationValue(com.navercorp.pinpoint.grpc.trace.PAnnotationValue) IntBooleanIntBooleanValue(com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue) PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue) TIntBooleanIntBooleanValue(com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) TLongIntIntByteByteStringValue(com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue) PLongIntIntByteByteStringValue(com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue) LongIntIntByteByteStringValue(com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue) PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) PStringStringValue(com.navercorp.pinpoint.grpc.trace.PStringStringValue) StringStringValue(com.navercorp.pinpoint.common.util.StringStringValue) IntStringStringValue(com.navercorp.pinpoint.common.util.IntStringStringValue) PIntStringStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringStringValue) TStringStringValue(com.navercorp.pinpoint.thrift.dto.TStringStringValue) TIntStringStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringStringValue) PIntStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringValue) IntStringValue(com.navercorp.pinpoint.common.util.IntStringValue) PIntStringValue(com.navercorp.pinpoint.grpc.trace.PIntStringValue) TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) DataType(com.navercorp.pinpoint.common.util.DataType)

Example 2 with PIntBooleanIntBooleanValue

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);
}
Also used : PAnnotationValue(com.navercorp.pinpoint.grpc.trace.PAnnotationValue) IntBooleanIntBooleanValue(com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue) PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue) PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue) Test(org.junit.Test)

Example 3 with PIntBooleanIntBooleanValue

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;
}
Also used : PIntBooleanIntBooleanValue(com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue)

Aggregations

PIntBooleanIntBooleanValue (com.navercorp.pinpoint.grpc.trace.PIntBooleanIntBooleanValue)3 IntBooleanIntBooleanValue (com.navercorp.pinpoint.common.util.IntBooleanIntBooleanValue)2 PAnnotationValue (com.navercorp.pinpoint.grpc.trace.PAnnotationValue)2 DataType (com.navercorp.pinpoint.common.util.DataType)1 IntStringStringValue (com.navercorp.pinpoint.common.util.IntStringStringValue)1 IntStringValue (com.navercorp.pinpoint.common.util.IntStringValue)1 LongIntIntByteByteStringValue (com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue)1 StringStringValue (com.navercorp.pinpoint.common.util.StringStringValue)1 PIntStringStringValue (com.navercorp.pinpoint.grpc.trace.PIntStringStringValue)1 PIntStringValue (com.navercorp.pinpoint.grpc.trace.PIntStringValue)1 PLongIntIntByteByteStringValue (com.navercorp.pinpoint.grpc.trace.PLongIntIntByteByteStringValue)1 PStringStringValue (com.navercorp.pinpoint.grpc.trace.PStringStringValue)1 TIntBooleanIntBooleanValue (com.navercorp.pinpoint.thrift.dto.TIntBooleanIntBooleanValue)1 TIntStringStringValue (com.navercorp.pinpoint.thrift.dto.TIntStringStringValue)1 TIntStringValue (com.navercorp.pinpoint.thrift.dto.TIntStringValue)1 TLongIntIntByteByteStringValue (com.navercorp.pinpoint.thrift.dto.TLongIntIntByteByteStringValue)1 TStringStringValue (com.navercorp.pinpoint.thrift.dto.TStringStringValue)1 Test (org.junit.Test)1