MCPcopy Create free account
hub / github.com/davidgiven/luje / getDeclaringClass

Method getDeclaringClass

lib/java/lang/Enum.java:139–147  ·  view source on GitHub ↗

Returns the enum constant's declaring class. @return the class object representing the constant's enum type.

()

Source from the content-addressed store, hash-verified

137 * @return the class object representing the constant's enum type.
138 */
139 @SuppressWarnings("unchecked")
140 public final Class<E> getDeclaringClass() {
141 Class<?> myClass = getClass();
142 Class<?> mySuperClass = myClass.getSuperclass();
143 if (Enum.class == mySuperClass) {
144 return (Class<E>)myClass;
145 }
146 return (Class<E>)mySuperClass;
147 }
148
149 /**
150 * Returns the constant with the specified name of the specified enum type.

Callers

nothing calls this directly

Calls 2

getClassMethod · 0.80
getSuperclassMethod · 0.80

Tested by

no test coverage detected