Class SourceLocation.Builder (3.8.0)

public static final class SourceLocation.Builder

A builder for SourceLocation objects.

Inheritance

java.lang.Object > SourceLocation.Builder

Methods

build()

public SourceLocation build()
Returns
TypeDescription
SourceLocation

setFile(String file)

public SourceLocation.Builder setFile(String file)

Sets the source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.

Parameter
NameDescription
fileString
Returns
TypeDescription
SourceLocation.Builder

setFunction(String function)

public SourceLocation.Builder setFunction(String function)

Sets the human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language.

Parameter
NameDescription
functionString
Returns
TypeDescription
SourceLocation.Builder

setLine(Long line)

public SourceLocation.Builder setLine(Long line)

Sets the line within the source file. 1-based; 0 indicates no line number available.

Parameter
NameDescription
lineLong
Returns
TypeDescription
SourceLocation.Builder