Class FilePosition
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.FilePosition
-
- All Implemented Interfaces:
java.io.Serializable
@API(status=STABLE, since="1.0") public class FilePosition extends java.lang.Object implements java.io.Serializable
- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
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.java.util.Optional<java.lang.Integer>
getColumn()
Get the column number of thisFilePosition
, if available.int
getLine()
Get the line number of thisFilePosition
.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
from
public static FilePosition from(int line)
Create a newFilePosition
using the suppliedline
number and an undefined column number.- Parameters:
line
- the line number; must be greater than zero
-
from
public static FilePosition from(int line, int column)
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
-
getLine
public int getLine()
Get the line number of thisFilePosition
.- Returns:
- the line number
-
getColumn
public java.util.Optional<java.lang.Integer> getColumn()
Get the column number of thisFilePosition
, if available.- Returns:
- an
Optional
containing the column number; nevernull
but potentially empty
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-