Class TraceDiagnostic<S extends JavaFileObject>
java.lang.Object
io.github.ascopes.jct.diagnostics.TraceDiagnostic<S>
- Type Parameters:
S- the file type.
- All Implemented Interfaces:
Diagnostic<S>
A wrapper around a
Diagnostic which contains additional information about where the
diagnostic was reported.- Since:
- 0.0.1
- Author:
- Ashley Scopes
-
Nested Class Summary
Nested classes/interfaces inherited from interface Diagnostic
Diagnostic.Kind -
Field Summary
Fields inherited from interface Diagnostic
NOPOS -
Constructor Summary
ConstructorsConstructorDescriptionTraceDiagnostic(Instant timestamp, long threadId, @Nullable String threadName, List<StackTraceElement> stackTrace, Diagnostic<? extends S> original) Initialize this diagnostic. -
Method Summary
Modifier and TypeMethodDescriptiongetCode()longlonggetKind()longgetMessage(@Nullable Locale locale) longGet the stacktrace of where the diagnostic was written from.longlongGet the thread ID for the thread that created this diagnostic.Get the thread name for the thread that created this diagnostic.Get the timestamp that the diagnostic was created at.toString()
-
Constructor Details
-
TraceDiagnostic
public TraceDiagnostic(Instant timestamp, long threadId, @Nullable String threadName, List<StackTraceElement> stackTrace, Diagnostic<? extends S> original) Initialize this diagnostic.- Parameters:
timestamp- the timestamp.threadId- the thread ID.threadName- the thread name, ornullif not known.stackTrace- the stacktrace.original- the original diagnostic that was reported.
-
-
Method Details
-
getKind
- Specified by:
getKindin interfaceDiagnostic<S extends JavaFileObject>
-
getSource
- Specified by:
getSourcein interfaceDiagnostic<S extends JavaFileObject>
-
getPosition
- Specified by:
getPositionin interfaceDiagnostic<S extends JavaFileObject>
-
getStartPosition
- Specified by:
getStartPositionin interfaceDiagnostic<S extends JavaFileObject>
-
getEndPosition
- Specified by:
getEndPositionin interfaceDiagnostic<S extends JavaFileObject>
-
getLineNumber
- Specified by:
getLineNumberin interfaceDiagnostic<S extends JavaFileObject>
-
getColumnNumber
- Specified by:
getColumnNumberin interfaceDiagnostic<S extends JavaFileObject>
-
getCode
- Specified by:
getCodein interfaceDiagnostic<S extends JavaFileObject>
-
getMessage
- Specified by:
getMessagein interfaceDiagnostic<S extends JavaFileObject>
-
getTimestamp
Get the timestamp that the diagnostic was created at.- Returns:
- the diagnostic timestamp.
-
getThreadId
Get the thread ID for the thread that created this diagnostic.- Returns:
- the thread ID.
-
getThreadName
Get the thread name for the thread that created this diagnostic.- Returns:
- the thread name, if known, or else
null.
-
getStackTrace
Get the stacktrace of where the diagnostic was written from.- Returns:
- the stacktrace, in an unmodifiable list.
-
toString
-