Package software.amazon.smithy.model
Class SourceLocation
- java.lang.Object
-
- software.amazon.smithy.model.SourceLocation
-
- All Implemented Interfaces:
java.lang.Comparable<SourceLocation>,FromSourceLocation
public final class SourceLocation extends java.lang.Object implements FromSourceLocation, java.lang.Comparable<SourceLocation>
Represents the source location of a model component.
-
-
Field Summary
Fields Modifier and Type Field Description static SourceLocationNONE
-
Constructor Summary
Constructors Constructor Description SourceLocation(java.lang.String filename)SourceLocation(java.lang.String filename, int line, int column)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(SourceLocation o)booleanequals(java.lang.Object other)intgetColumn()java.lang.StringgetFilename()intgetLine()SourceLocationgetSourceLocation()Gets the source location of a value.inthashCode()static SourceLocationnone()Creates an empty source location.java.lang.StringtoString()
-
-
-
Field Detail
-
NONE
public static final SourceLocation NONE
-
-
Method Detail
-
none
public static SourceLocation none()
Creates an empty source location.- Returns:
- Returns the empty location.
-
getFilename
public java.lang.String getFilename()
- Returns:
- Returns the source location filename.
-
getLine
public int getLine()
- Returns:
- Returns the line number from which the component originated.
-
getColumn
public int getColumn()
- Returns:
- Returns the column from which the component originated.
-
getSourceLocation
public SourceLocation getSourceLocation()
Description copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
getSourceLocationin interfaceFromSourceLocation- Returns:
- Returns the source location of the value.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(SourceLocation o)
- Specified by:
compareToin interfacejava.lang.Comparable<SourceLocation>
-
-