public class MirrorClass<T>
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
MirrorConstructor<T> |
constructor(java.lang.Class<?>... types)
Retrieves the constructor for this class that takes the given types
|
java.util.Optional<MirrorField> |
declaredField(java.lang.String... names)
Finds the first declared field with one of the given names
|
FieldStream |
declaredFields() |
java.util.Optional<MirrorMethod> |
declaredMethod(java.lang.String[] names,
java.lang.Class<?>... args)
Finds the first declared method with one of the given names that accepts the given arguments
|
java.util.Optional<MirrorMethod> |
declaredMethod(java.lang.String name,
java.lang.Class<?>... args)
Finds the first declared method with one of the given names that accepts the given arguments
|
MethodStream |
declaredMethods() |
boolean |
equals(java.lang.Object o) |
java.util.Optional<MirrorField> |
field(java.lang.String... names)
Finds the first field with one of the given names
|
FieldStream |
fields() |
java.lang.String |
fullName() |
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> clazz)
Retrieves the given annotation on the class
|
MirrorClass<?>[] |
getInterfaces() |
MirrorClass<? super T> |
getSuperClass() |
boolean |
hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Checks if the class has the given annotation
|
int |
hashCode() |
boolean |
isInner() |
boolean |
isInterface() |
boolean |
isNotInner() |
boolean |
isNotInterface() |
boolean |
isSubClassOf(java.lang.Class<?> clazz)
Tests if this class is a sub-class of the given class
|
boolean |
isSubClassOf(MirrorClass<?> clazz)
Tests if this class is a sub-class of the given class
|
boolean |
isSuperClassOf(java.lang.Class<?> clazz)
Tests if this class is a super-class of the given class
|
boolean |
isSuperClassOf(MirrorClass<?> clazz)
Tests if this class is a super-class of the given class
|
java.util.Optional<MirrorMethod> |
method(java.lang.String[] names,
java.lang.Class<?>... args)
Finds the first method with one of the given names that accepts the given arguments
|
java.util.Optional<MirrorMethod> |
method(java.lang.String name,
java.lang.Class<?>... args)
Finds the first method with one of the given names that accepts the given arguments
|
MethodStream |
methods() |
java.lang.String |
simpleName() |
java.lang.Class<T> |
unwrap() |
protected final java.lang.Class<T> clazz
public java.lang.Class<T> unwrap()
Class
corresponding to this mirror classpublic java.lang.String simpleName()
public java.lang.String fullName()
public MirrorConstructor<T> constructor(java.lang.Class<?>... types)
types
- The types that the constructor acceptspublic boolean hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
clazz
- The annotation classpublic <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> clazz)
A
- The type of the annotationclazz
- The annotation classpublic boolean isInner()
public boolean isNotInner()
public boolean isSubClassOf(java.lang.Class<?> clazz)
clazz
- The classpublic boolean isSubClassOf(MirrorClass<?> clazz)
clazz
- The classpublic boolean isSuperClassOf(java.lang.Class<?> clazz)
clazz
- The classpublic boolean isSuperClassOf(MirrorClass<?> clazz)
clazz
- The classpublic boolean isInterface()
public boolean isNotInterface()
public MirrorClass<? super T> getSuperClass()
public MirrorClass<?>[] getInterfaces()
public FieldStream fields()
FieldStream
of all the fields in this classpublic FieldStream declaredFields()
FieldStream
of all the declared fields in this classpublic java.util.Optional<MirrorField> field(java.lang.String... names)
names
- The names of the fields to search forpublic java.util.Optional<MirrorField> declaredField(java.lang.String... names)
names
- The names of the fields to search forpublic MethodStream methods()
public MethodStream declaredMethods()
public java.util.Optional<MirrorMethod> method(java.lang.String[] names, java.lang.Class<?>... args)
names
- The names of the methodargs
- The arguments the method acceptspublic java.util.Optional<MirrorMethod> method(java.lang.String name, java.lang.Class<?>... args)
name
- The names of the methodargs
- The arguments the method acceptspublic java.util.Optional<MirrorMethod> declaredMethod(java.lang.String[] names, java.lang.Class<?>... args)
names
- The names of the methodargs
- The arguments the method acceptspublic java.util.Optional<MirrorMethod> declaredMethod(java.lang.String name, java.lang.Class<?>... args)
name
- The names of the methodargs
- The arguments the method acceptspublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object