@API(status=STABLE,
since="1.0")
public class FilePosition
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Integer |
column |
private int |
line |
private static long |
serialVersionUID |
| Modifier | Constructor and Description |
|---|---|
private |
FilePosition(int line) |
private |
FilePosition(int line,
int column) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
static FilePosition |
from(int line)
Create a new
FilePosition using the supplied line number
and an undefined column number. |
static FilePosition |
from(int line,
int column)
Create a new
FilePosition using the supplied line and
column numbers. |
java.util.Optional<java.lang.Integer> |
getColumn()
Get the column number of this
FilePosition, if available. |
int |
getLine()
Get the line number of this
FilePosition. |
int |
hashCode() |
java.lang.String |
toString() |
private static final long serialVersionUID
private final int line
private final java.lang.Integer column
private FilePosition(int line)
private FilePosition(int line,
int column)
public static FilePosition from(int line)
FilePosition using the supplied line number
and an undefined column number.line - the line number; must be greater than zeropublic static FilePosition from(int line, int column)
FilePosition using the supplied line and
column numbers.line - the line number; must be greater than zerocolumn - the column number; must be greater than zeropublic int getLine()
FilePosition.public java.util.Optional<java.lang.Integer> getColumn()
FilePosition, if available.Optional containing the column number; never
null but potentially emptypublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object