ThriftEnumUtils { public static String enumToString(TEnum value) { String out = ""; if (value != null) { out = MAP_ENUMTYPE_MAP.get(value.getClass()).get(value); } return out; } private  ThriftEnumUtils(); static String enumToString(TEnum value); static T stringToEnum(String in, Class<T> clazz); static T enumByString(String in, Class<T> clazz); static String enumToShortString(TEnum value); static T enumByShortString(String in, Class<T> clazz); static final ImmutableMap<AttachmentType, String> MAP_ATTACHMENT_TYPE_SHORT_STRING; static final ImmutableMap<Class<? extends TEnum>, Map<? extends TEnum, String>> MAP_ENUMTYPE_MAP; static final ImmutableMap<Class<? extends TEnum>, Map<? extends TEnum, String>> MAP_ENUMTYPE_SHORT_STRING_MAP; }
@Test public void testToString() { assertThat(ThriftEnumUtils.enumToString(AttachmentType.DESIGN), is("Design document")); assertThat(ThriftEnumUtils.enumToString(RepositoryType.GIT), is("Git")); }