java.lang.Object
org.junit.platform.engine.discovery.FilePosition
- All Implemented Interfaces:
Serializable
- Since:
- 1.7
- See Also:
- Implementation Note:
- This class is a copy of
FilePosition
, which is not accessible from this package. The decision to duplicate it is motivated by an eventual divergence between the two classes in the future.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static FilePosition
from
(int line) Create a newFilePosition
using the suppliedline
number and an undefined column number.static FilePosition
from
(int line, int column) Create a newFilePosition
using the suppliedline
andcolumn
numbers.static Optional
<FilePosition> Create an optionalFilePosition
by parsing the suppliedquery
string.Get the column number of thisFilePosition
, if available.int
getLine()
Get the line number of thisFilePosition
.int
hashCode()
toString()
-
Method Details
-
from
Create a newFilePosition
using the suppliedline
number and an undefined column number.- Parameters:
line
- the line number; must be greater than zero- Returns:
- a
FilePosition
with the given line number
-
from
Create a newFilePosition
using the suppliedline
andcolumn
numbers.- Parameters:
line
- the line number; must be greater than zerocolumn
- the column number; must be greater than zero- Returns:
- a
FilePosition
with the given line and column numbers
-
fromQuery
Create an optionalFilePosition
by parsing the suppliedquery
string.Examples of valid
query
strings:"line=23"
"line=23&column=42"
- Parameters:
query
- the query string; may benull
- Returns:
- an
Optional
containing aFilePosition
with the parsed line and column numbers; nevernull
but potentially empty - Since:
- 1.3
- See Also:
-
getLine
public int getLine()Get the line number of thisFilePosition
.- Returns:
- the line number
-
getColumn
Get the column number of thisFilePosition
, if available.- Returns:
- an
Optional
containing the column number; nevernull
but potentially empty
-
equals
-
hashCode
public int hashCode() -
toString
-