@API(status=STABLE, since="1.0") public class ClasspathResourceSource extends Object implements TestSource
TestSource
with an optional position.ClasspathResourceSelector,
Serialized Form| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
static ClasspathResourceSource |
from(String classpathResourceName)
Create a new
ClasspathResourceSource using the supplied classpath
resource name. |
static ClasspathResourceSource |
from(String classpathResourceName,
FilePosition filePosition)
Create a new
ClasspathResourceSource using the supplied classpath
resource name and FilePosition. |
String |
getClasspathResourceName()
Get the name of the source classpath resource.
|
Optional<FilePosition> |
getPosition()
Get the
FilePosition, if available. |
int |
hashCode() |
String |
toString() |
public static ClasspathResourceSource from(String classpathResourceName)
ClasspathResourceSource using the supplied classpath
resource name.
The name of a classpath resource must follow the semantics
for resource paths as defined in ClassLoader.getResource(String).
If the supplied classpath resource name is prefixed with a slash
(/), the slash will be removed.
classpathResourceName - the name of the classpath resource; never
null or blankClassLoader.getResource(String),
ClassLoader.getResourceAsStream(String),
ClassLoader.getResources(String)public static ClasspathResourceSource from(String classpathResourceName, FilePosition filePosition)
ClasspathResourceSource using the supplied classpath
resource name and FilePosition.
The name of a classpath resource must follow the semantics
for resource paths as defined in ClassLoader.getResource(String).
If the supplied classpath resource name is prefixed with a slash
(/), the slash will be removed.
classpathResourceName - the name of the classpath resource; never
null or blankfilePosition - the position in the classpath resource; may be nullpublic String getClasspathResourceName()
The name of a classpath resource follows the semantics for
resource paths as defined in ClassLoader.getResource(String).
public final Optional<FilePosition> getPosition()
FilePosition, if available.