T - the class's type.public final class ClassOf<T> extends Object implements RefClass<T>
RefClass.| Constructor and Description |
|---|
ClassOf(@NotNull Class<T> clazz)
ctor.
|
ClassOf(@NotNull String classname) |
ClassOf(T object) |
| Modifier and Type | Method and Description |
|---|---|
<A extends Annotation> |
getAnnotation(@NotNull Class<A> annotationClass)
gets the annotation from the given annotation class.
|
@NotNull Optional<RefConstructed<T>> |
getConstructor(int number)
gets constructor by number of arguments.
|
@NotNull Optional<RefConstructed<T>> |
getConstructor(Object... types)
gets existing constructor by types.
|
@NotNull List<RefField> |
getDeclaredFields()
gets all declared fields.
|
@NotNull List<RefMethod> |
getDeclaredMethods()
gets all declared methods.
|
@NotNull Optional<RefField> |
getField(@NotNull Class<?> type)
gets field by type.
|
<X> @NotNull Optional<RefField> |
getField(@NotNull RefClass<X> type)
gets field by type.
|
@NotNull Optional<RefField> |
getField(@NotNull String name)
gets field by name.
|
@NotNull List<RefField> |
getFields()
gets all fields.
|
@NotNull Optional<RefMethod> |
getMethod(@NotNull String name,
Object... types)
gets existing method by name and types.
|
@NotNull Optional<RefMethod> |
getMethodByName(String... names)
gets method by name.
|
@NotNull Optional<RefMethod> |
getMethodByParameter(Object... types)
gets method by type parameters.
|
@NotNull Optional<RefMethod> |
getMethodByReturnType(@NotNull Class<?> type)
gets method by return value.
|
<X> @NotNull Optional<RefMethod> |
getMethodByReturnType(@NotNull RefClass<X> type)
gets method by return value.
|
@NotNull List<RefMethod> |
getMethods()
gets all methods.
|
@NotNull Optional<RefConstructed<T>> |
getPrimitiveConstructor(Object... types)
gets existing constructor by types.
|
@NotNull Optional<RefMethod> |
getPrimitiveMethod(@NotNull String name,
Object... types)
gets existing method by name and types.
|
@NotNull Optional<RefMethod> |
getPrimitiveMethodByParameter(Object... types)
gets method by type parameters.
|
@NotNull Class<T> |
getRealClass()
obtains the real class.
|
boolean |
isInstance(@NotNull Object object)
checks if the given object is instance of
this. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDeclaredFieldsWithAnnotation, getDeclaredFieldsWithAnnotation, getDeclaredMethodsWithAnnotation, getDeclaredMethodsWithAnnotation, getFieldsWithAnnotation, getFieldsWithAnnotation, getMethodsWithAnnotation, getMethodsWithAnnotationgetAnnotation, hasAnnotationpublic ClassOf(@NotNull
T object)
public ClassOf(@NotNull
@NotNull String classname)
throws ClassNotFoundException
ClassNotFoundException@NotNull public @NotNull Class<T> getRealClass()
RefClassgetRealClass in interface RefClass<T>public boolean isInstance(@NotNull
@NotNull Object object)
RefClassthis.isInstance in interface RefClass<T>object - the object to check.Class.isInstance(Object)@NotNull public @NotNull Optional<RefMethod> getPrimitiveMethod(@NotNull @NotNull String name, @NotNull Object... types)
RefClassgetPrimitiveMethod in interface RefClass<T>name - the name to get.types - the method parameter types to get.RefMethod object.@NotNull public @NotNull Optional<RefMethod> getMethod(@NotNull @NotNull String name, @NotNull Object... types)
RefClass@NotNull public @NotNull Optional<RefMethod> getPrimitiveMethodByParameter(@NotNull Object... types)
RefClassgetPrimitiveMethodByParameter in interface RefClass<T>types - the parameter types to get.RefMethod object.@NotNull public @NotNull Optional<RefMethod> getMethodByParameter(@NotNull Object... types)
RefClassgetMethodByParameter in interface RefClass<T>types - the parameter types to get.RefMethod object.@NotNull public @NotNull Optional<RefMethod> getMethodByName(@NotNull String... names)
RefClassgetMethodByName in interface RefClass<T>names - the names to get.RefMethod object.@NotNull public <X> @NotNull Optional<RefMethod> getMethodByReturnType(@NotNull @NotNull RefClass<X> type)
RefClassgetMethodByReturnType in interface RefClass<T>X - the class type of the return type.type - the type to get.RefMethod object.@NotNull public @NotNull Optional<RefMethod> getMethodByReturnType(@NotNull @NotNull Class<?> type)
RefClassgetMethodByReturnType in interface RefClass<T>type - the type to get.RefMethod object.@NotNull public @NotNull Optional<RefConstructed<T>> getPrimitiveConstructor(@NotNull Object... types)
RefClassgetPrimitiveConstructor in interface RefClass<T>types - the parameter types to get.RefConstructed object.@NotNull public @NotNull Optional<RefConstructed<T>> getConstructor(@NotNull Object... types)
RefClassgetConstructor in interface RefClass<T>types - the parameter types to get.RefConstructed object.@NotNull public @NotNull Optional<RefConstructed<T>> getConstructor(int number)
RefClassgetConstructor in interface RefClass<T>number - the number to get.RefConstructed object.@NotNull public @NotNull Optional<RefField> getField(@NotNull @NotNull String name)
RefClass@NotNull public <X> @NotNull Optional<RefField> getField(@NotNull @NotNull RefClass<X> type)
RefClass@NotNull public @NotNull Optional<RefField> getField(@NotNull @NotNull Class<?> type)
RefClass@NotNull public @NotNull List<RefField> getFields()
RefClass@NotNull public @NotNull List<RefField> getDeclaredFields()
RefClassgetDeclaredFields in interface RefClass<T>@NotNull public @NotNull List<RefMethod> getMethods()
RefClassgetMethods in interface RefClass<T>@NotNull public @NotNull List<RefMethod> getDeclaredMethods()
RefClassgetDeclaredMethods in interface RefClass<T>public <A extends Annotation> Optional<A> getAnnotation(@NotNull @NotNull Class<A> annotationClass)
RefAnnotatedgetAnnotation in interface RefAnnotatedA - the annotation type.annotationClass - the annotation class to get.this have the given
annotation class.Copyright © 2021. All rights reserved.