JaegerThriftSpanConverter { static Tag buildTag(String tagKey, Object tagValue) { Tag tag = new Tag(); tag.setKey(tagKey); if (tagValue instanceof Integer || tagValue instanceof Short || tagValue instanceof Long) { tag.setVType(TagType.LONG); tag.setVLong(((Number) tagValue).longValue()); } else if (tagValue instanceof Double || tagValue instanceof Float) { tag.setVType(TagType.DOUBLE); tag.setVDouble(((Number) tagValue).doubleValue()); } else if (tagValue instanceof Boolean) { tag.setVType(TagType.BOOL); tag.setVBool((Boolean) tagValue); } else { buildStringTag(tag, tagValue); } return tag; } private  JaegerThriftSpanConverter(); static io.jaegertracing.thriftjava.Span convertSpan(JaegerSpan jaegerSpan); static List<Tag> buildTags(Map<String, ?> tags);  }
@Test @UseDataProvider("dataProviderBuildTag") public void testBuildTag(Object tagValue, TagType tagType, Object expected) { Tag tag = JaegerThriftSpanConverter.buildTag("key", tagValue); assertEquals(tagType, tag.getVType()); assertEquals("key", tag.getKey()); switch (tagType) { case STRING: default: assertEquals(expected, tag.getVStr()); break; case BOOL: assertEquals(expected, tag.isVBool()); break; case LONG: assertEquals(expected, tag.getVLong()); break; case DOUBLE: assertEquals(expected, tag.getVDouble()); break; case BINARY: break; } }