@API(status=STABLE, since="1.6") public class NestedClassSelector extends java.lang.Object implements DiscoverySelector
DiscoverySelector
that selects a nested Class
or class name enclosed in other classes so that
TestEngines
can discover
tests or containers based on classes.
If Java Class
references are provided for the nested class or
the enclosing classes, the selector will return these Class
and
their class names accordingly. If class names are provided, the selector
will only attempt to lazily load the Class
if
getEnclosingClasses()
or getNestedClass()
are invoked.
In this context, Java Class
means anything that can be referenced
as a Class
on the JVM — for example, classes from other JVM
languages such Groovy, Scala, etc.
Modifier and Type | Field and Description |
---|---|
private java.util.List<ClassSelector> |
enclosingClassSelectors |
private ClassSelector |
nestedClassSelector |
Constructor and Description |
---|
NestedClassSelector(java.util.List<java.lang.Class<?>> enclosingClasses,
java.lang.Class<?> nestedClass) |
NestedClassSelector(java.util.List<java.lang.String> enclosingClassNames,
java.lang.String nestedClassName) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.util.List<java.lang.Class<?>> |
getEnclosingClasses()
Get the list of
Class enclosing the selected nested
Class . |
java.util.List<java.lang.String> |
getEnclosingClassNames()
Get the names of the classes enclosing the selected nested class.
|
java.lang.Class<?> |
getNestedClass()
Get the selected nested
Class . |
java.lang.String |
getNestedClassName()
Get the name of the selected nested class.
|
int |
hashCode() |
java.lang.String |
toString() |
private java.util.List<ClassSelector> enclosingClassSelectors
private ClassSelector nestedClassSelector
NestedClassSelector(java.util.List<java.lang.String> enclosingClassNames, java.lang.String nestedClassName)
NestedClassSelector(java.util.List<java.lang.Class<?>> enclosingClasses, java.lang.Class<?> nestedClass)
public java.util.List<java.lang.String> getEnclosingClassNames()
public java.util.List<java.lang.Class<?>> getEnclosingClasses()
Class
enclosing the selected nested
Class
.
If the Class
were not provided, but only the name of the
nested class and its enclosing classes, this method attempts to lazily
load the list of enclosing Class
and throws a
PreconditionViolationException
if the classes cannot be loaded.
public java.lang.String getNestedClassName()
public java.lang.Class<?> getNestedClass()
Class
.
If the Class
were not provided, but only the name of the
nested class and its enclosing classes, this method attempts to lazily
load the nested Class
and throws a
PreconditionViolationException
if the class cannot be loaded.
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object