public class ClassAliasPool extends Object implements ClassLookup
Modifier and Type | Field and Description |
---|---|
static ClassAliasPool |
CLASS_ALIASES |
Modifier and Type | Method and Description |
---|---|
static void |
a(Class... classes) |
static void |
a(Class<?> clazz) |
void |
addAlias(Class<?>... classes)
Adds one or more classes to the class lookup.
|
void |
addAlias(Class<?> clazz,
@NotNull String names)
Adds a class to the class lookup with one or more specified aliases.
|
void |
clean()
Removes classes from the lookup which are not loaded by the default class loaders.
|
@NotNull Class<?> |
forName(@NotNull CharSequence name)
Looks up and returns the Class object associated with the given class name.
|
String |
nameFor(Class<?> clazz)
Retrieves the alias for the given class.
|
void |
removePackage(String pkgName) |
protected static boolean |
testPackage(String pkgName,
Class<?> clazz) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
wrap, wrap
public static final ClassAliasPool CLASS_ALIASES
public static void a(Class<?> clazz)
public void clean()
@NotNull public @NotNull Class<?> forName(@NotNull @NotNull CharSequence name) throws ClassNotFoundRuntimeException
ClassLookup
forName
in interface ClassLookup
name
- The fully qualified name of the desired class.ClassNotFoundRuntimeException
- If the class cannot be located.public String nameFor(Class<?> clazz) throws IllegalArgumentException
ClassLookup
nameFor
in interface ClassLookup
clazz
- The class to retrieve the alias for.IllegalArgumentException
- If this method is used on a lambda function.public void removePackage(String pkgName)
public void addAlias(@NotNull Class<?>... classes)
ClassLookup
addAlias
in interface ClassLookup
classes
- The classes to be added to the class lookup.public void addAlias(Class<?> clazz, @NotNull @NotNull String names)
ClassLookup
addAlias
in interface ClassLookup
clazz
- The class to be added to the class lookup.names
- A single alias or a comma-separated string of aliases for the class.public static void a(Class... classes)
Copyright © 2023. All rights reserved.