MCPcopy Index your code
hub / github.com/antlr/codebuff / getField

Method getField

output/java_guava/1.4.17/Enums.java:52–60  ·  view source on GitHub ↗

Returns the Field in which enumValue is defined. For example, to get the Description annotation on the GOLF constant of enum Sport, use Enums.getField(Sport.GOLF).getAnnotation(Description.class). @since 12.0

(Enum<?> enumValue)

Source from the content-addressed store, hash-verified

50 */
51
52 @GwtIncompatible // reflection
53 public static Field getField(Enum<?> enumValue) {
54 Class<?> clazz = enumValue.getDeclaringClass();
55 try {
56 return clazz.getDeclaredField(enumValue.name());
57 } catch (NoSuchFieldException impossible) {
58 throw new AssertionError(impossible);
59 }
60 }
61
62 /**
63 * Returns an optional enum constant for the given type, using {@link Enum#valueOf}. If the

Callers 15

tryGetFieldMethod · 0.45
tryGetFieldMethod · 0.45
tryGetFieldMethod · 0.45
tryGetFieldMethod · 0.45
tryGetFieldMethod · 0.45
tryGetFieldMethod · 0.45
tryGetFieldMethod · 0.45
tryGetFieldMethod · 0.45
tryGetFieldMethod · 0.45
tryGetFieldMethod · 0.45
tryGetFieldMethod · 0.45
tryGetFieldMethod · 0.45

Calls 1

getDeclaringClassMethod · 0.45

Tested by

no test coverage detected