use of com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue in project pinpoint by naver.
the class AnnotationRecordFormatter method formatTitle.
public String formatTitle(final AnnotationKey annotationKey, final AnnotationBo annotationBo, Align align) {
if (annotationKey.getCode() == AnnotationKey.PROXY_HTTP_HEADER.getCode()) {
if (!(annotationBo.getValue() instanceof LongIntIntByteByteStringValue)) {
return proxyRequestTypeRegistryService.unknown().getDisplayName();
}
final LongIntIntByteByteStringValue value = (LongIntIntByteByteStringValue) annotationBo.getValue();
final ProxyRequestType type = this.proxyRequestTypeRegistryService.findByCode(value.getIntValue1());
return type.getDisplayName(value.getStringValue());
}
return annotationKey.getName();
}
use of com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue in project pinpoint by naver.
the class DataTypeAnnotation method apply.
@Override
public TAnnotationValue apply(AnnotationValueThriftMapper context) {
final DataType dataType = this.value;
if (dataType instanceof IntStringValue) {
final IntStringValue v = (IntStringValue) dataType;
final TIntStringValue tIntStringValue = new TIntStringValue(v.getIntValue());
if (v.getStringValue() != null) {
tIntStringValue.setStringValue(v.getStringValue());
}
return TAnnotationValue.intStringValue(tIntStringValue);
} else if (dataType instanceof StringStringValue) {
final StringStringValue v = (StringStringValue) dataType;
final TStringStringValue tStringStringValue = new TStringStringValue(v.getStringValue1());
if (v.getStringValue2() != null) {
tStringStringValue.setStringValue2(v.getStringValue2());
}
return TAnnotationValue.stringStringValue(tStringStringValue);
} else if (dataType instanceof IntStringStringValue) {
final IntStringStringValue v = (IntStringStringValue) dataType;
final TIntStringStringValue tIntStringStringValue = new TIntStringStringValue(v.getIntValue());
if (v.getStringValue1() != null) {
tIntStringStringValue.setStringValue1(v.getStringValue1());
}
if (v.getStringValue2() != null) {
tIntStringStringValue.setStringValue2(v.getStringValue2());
}
return TAnnotationValue.intStringStringValue(tIntStringStringValue);
} else if (dataType instanceof LongIntIntByteByteStringValue) {
final LongIntIntByteByteStringValue v = (LongIntIntByteByteStringValue) dataType;
final TLongIntIntByteByteStringValue tvalue = new TLongIntIntByteByteStringValue(v.getLongValue(), v.getIntValue1());
if (v.getIntValue2() != -1) {
tvalue.setIntValue2(v.getIntValue2());
}
if (v.getByteValue1() != -1) {
tvalue.setByteValue1(v.getByteValue1());
}
if (v.getByteValue2() != -1) {
tvalue.setByteValue2(v.getByteValue2());
}
if (v.getStringValue() != null) {
tvalue.setStringValue(v.getStringValue());
}
return TAnnotationValue.longIntIntByteByteStringValue(tvalue);
} else if (dataType instanceof IntBooleanIntBooleanValue) {
final IntBooleanIntBooleanValue v = (IntBooleanIntBooleanValue) dataType;
final TIntBooleanIntBooleanValue tvalue = new TIntBooleanIntBooleanValue(v.getIntValue1(), v.isBooleanValue1(), v.getIntValue2(), v.isBooleanValue2());
return TAnnotationValue.intBooleanIntBooleanValue(tvalue);
}
throw new UnsupportedOperationException("unsupported type:" + dataType);
}
use of com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue in project pinpoint by naver.
the class AnnotationTranscoderTest method testLongIntIntByteByteString.
private void testLongIntIntByteByteString(long longValue, int intValue1, int intValue2, byte byteValue1, byte byteValue2, String stringValue) {
AnnotationTranscoder transcoder = new AnnotationTranscoder();
LongIntIntByteByteStringValue value = new LongIntIntByteByteStringValue(longValue, intValue1, intValue2, byteValue1, byteValue2, stringValue);
byte[] encode = transcoder.encode(value, AnnotationTranscoder.CODE_LONG_INT_INT_BYTE_BYTE_STRING);
LongIntIntByteByteStringValue decode = (LongIntIntByteByteStringValue) transcoder.decode(AnnotationTranscoder.CODE_LONG_INT_INT_BYTE_BYTE_STRING, encode);
Assert.assertEquals(value.getLongValue(), decode.getLongValue());
Assert.assertEquals(value.getIntValue1(), decode.getIntValue1());
Assert.assertEquals(value.getIntValue2(), decode.getIntValue2());
Assert.assertEquals(value.getByteValue1(), decode.getByteValue1());
Assert.assertEquals(value.getByteValue2(), decode.getByteValue2());
Assert.assertEquals(value.getStringValue(), decode.getStringValue());
}
use of com.navercorp.pinpoint.common.util.LongIntIntByteByteStringValue 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