@Test public void testNameOfOrNull() throws Exception { assertThat(Util.nameOfOrNull("warn", Level.class), is("warn")); assertThat(Util.nameOfOrNull("null", Level.class), is(nullValue())); }
public static <T extends Enum<T>> String nameOfOrNull(String name, Class<T> type) { final T value = valueOfOrNull(name, type); return value != null ? value.name() : null; }
Util { public static <T extends Enum<T>> String nameOfOrNull(String name, Class<T> type) { final T value = valueOfOrNull(name, type); return value != null ? value.name() : null; } }
Util { public static <T extends Enum<T>> String nameOfOrNull(String name, Class<T> type) { final T value = valueOfOrNull(name, type); return value != null ? value.name() : null; } private  Util(); }
Util { public static <T extends Enum<T>> String nameOfOrNull(String name, Class<T> type) { final T value = valueOfOrNull(name, type); return value != null ? value.name() : null; } private  Util(); static T valueOfOrNull(String name, Class<T> type); static T valueOfOrDefault(String name, Class<T> type, T def); static String nameOfOrNull(String name, Class<T> type); }
Util { public static <T extends Enum<T>> String nameOfOrNull(String name, Class<T> type) { final T value = valueOfOrNull(name, type); return value != null ? value.name() : null; } private  Util(); static T valueOfOrNull(String name, Class<T> type); static T valueOfOrDefault(String name, Class<T> type, T def); static String nameOfOrNull(String name, Class<T> type);  }