MCPcopy Create free account
hub / github.com/QuiltMC/chasm / ClassInfo

Class ClassInfo

chasm/src/main/java/org/quiltmc/chasm/api/util/ClassInfo.java:12–113  ·  view source on GitHub ↗

Static information related to a specific class.

Source from the content-addressed store, hash-verified

10 * Static information related to a specific class.
11 */
12public class ClassInfo {
13 public static final String OBJECT = "java/lang/Object";
14
15 private final String className;
16 private final String superClass;
17 private final String[] interfaces;
18 private final boolean isInterface;
19
20 /**
21 * Construct a new {@link ClassInfo}.
22 *
23 * @param className The name of the class (see {@link #getClassName()}).
24 * @param superClass The name of the super class (see {@link #getSuperClass()}).
25 * @param interfaces The names of the implemented interfaces (see {@link #getInterfaces()}).
26 * @param isInterface Whether this class is an interface (see {@link #isInterface}).
27 */
28 public ClassInfo(String className, String superClass, String[] interfaces, boolean isInterface) {
29 this.className = className;
30 this.superClass = superClass;
31 this.interfaces = interfaces;
32 this.isInterface = isInterface;
33 }
34
35 /**
36 * Returns the internal name of the class (See {@link org.objectweb.asm.Type#getInternalName}).
37 *
38 * @return The internal name of the class.
39 */
40 public String getClassName() {
41 return className;
42 }
43
44 /**
45 * Returns the internal name of the super class (See {@link org.objectweb.asm.Type#getInternalName}).
46 * For interfaces, this should return {@link #OBJECT}.
47 * Only for the {@link Object} class ({@link #OBJECT}) will this return null.
48 *
49 * @return The internal name of the super class.
50 */
51 public String getSuperClass() {
52 return superClass;
53 }
54
55 /**
56 * Returns the internal names of the implemented interfaces (See {@link org.objectweb.asm.Type#getInternalName}).
57 *
58 * @return The internal names of the interfaces.
59 */
60 public String[] getInterfaces() {
61 return interfaces;
62 }
63
64 /**
65 * Returns whether the class is an interface.
66 *
67 * @return Whether the class is an interface.
68 */
69 public boolean isInterface() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected