Class VirtualClass
java.lang.Object
org.geysermc.conduit.VirtualClass
A class found by
ConduitContext.scanClasses(ClassFilter), by name.
Nothing is loaded until resolve() or isAssignableFrom(String) is called. Those load
the class through the context, without initializing it.
-
Constructor Summary
ConstructorsConstructorDescriptionVirtualClass(@NotNull Class<?> clazz, @NotNull ConduitContext context) Refers to a class by its loaded type.VirtualClass(@NotNull String className, @NotNull ConduitContext context) Refers to a class by name, without loading it. -
Method Summary
Modifier and TypeMethodDescription@NotNull StringThe binary name of the class, such ascom.example.Color.booleaninthashCode()booleanisAssignableFrom(@NotNull String interfaceName) Loads the class and checks whether it is a subtype of another.@NotNull Class<?> resolve()Loads the class from the context.
-
Constructor Details
-
VirtualClass
Refers to a class by its loaded type.- Parameters:
clazz- the classcontext- the context to load it from
-
VirtualClass
Refers to a class by name, without loading it.- Parameters:
className- the binary name of the classcontext- the context to load it from
-
-
Method Details
-
className
The binary name of the class, such ascom.example.Color.- Returns:
- the binary name of the class
-
resolve
Loads the class from the context.- Returns:
- the class
- Throws:
ClassNotFoundException- if it can't be loaded
-
isAssignableFrom
Loads the class and checks whether it is a subtype of another.- Parameters:
interfaceName- the binary name of the supertype- Returns:
- whether the class extends or implements it, false if either can't be loaded
-
equals
-
hashCode
-