@API(status=STABLE, since="1.0") public class ClassSource extends Object implements TestSource
TestSource
with an optional
position.ClassSelector
,
Serialized FormModifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static ClassSource |
from(Class<?> javaClass)
Create a new
ClassSource using the supplied
javaClass . |
static ClassSource |
from(Class<?> javaClass,
FilePosition filePosition)
|
static ClassSource |
from(String className)
Create a new
ClassSource using the supplied
className. |
static ClassSource |
from(String className,
FilePosition filePosition)
Create a new
ClassSource using the supplied
className and filePosition . |
String |
getClassName()
Get the class name of this source.
|
Class<?> |
getJavaClass()
Get the Java class of this source.
|
Optional<FilePosition> |
getPosition()
Get the position in the Java source file for
the associated Java class, if available.
|
int |
hashCode() |
String |
toString() |
public static ClassSource from(String className)
ClassSource
using the supplied
className.className
- the Java class name; must not be null
public static ClassSource from(String className, FilePosition filePosition)
ClassSource
using the supplied
className and filePosition
.className
- the Java class name; must not be null
filePosition
- the position in the Java source file; may be null
public static ClassSource from(Class<?> javaClass)
ClassSource
using the supplied
javaClass
.javaClass
- the Java class; must not be null
public static ClassSource from(Class<?> javaClass, FilePosition filePosition)
javaClass
- the Java class; must not be null
filePosition
- the position in the Java source file; may be null
public final String getClassName()
getPosition()
public final Class<?> getJavaClass()
getPosition()
public final Optional<FilePosition> getPosition()
getJavaClass()