Package dev.cel.common
Class CelIssue
- java.lang.Object
-
- dev.cel.common.CelIssue
-
@Immutable public abstract class CelIssue extends java.lang.Object
Encapulates aCelSourceLocation
and message representing an error within an expression.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CelIssue.Builder
Builder for configuringCelIssue
.static class
CelIssue.Severity
Severity of a CelIssue.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CelIssue
formatError(int line, int column, java.lang.String message)
BuildCelIssue
from the given line, column, format string, and arguments.static CelIssue
formatError(long exprId, CelSourceLocation sourceLocation, java.lang.String message)
BuildCelIssue
from the given expression id,CelSourceLocation
, format string, and arguments.static CelIssue
formatError(CelSourceLocation sourceLocation, java.lang.String message)
BuildCelIssue
from the givenCelSourceLocation
, format string, and arguments.abstract long
getExprId()
abstract java.lang.String
getMessage()
abstract CelIssue.Severity
getSeverity()
abstract CelSourceLocation
getSourceLocation()
static CelIssue.Builder
newBuilder()
java.lang.String
toDisplayString(Source source)
Returns a string representing this error that is suitable for displaying to humans.static java.lang.String
toDisplayString(java.util.Collection<CelIssue> issues, Source source)
Returns a human-readable error with all issues joined in a single string.
-
-
-
Method Detail
-
getSeverity
public abstract CelIssue.Severity getSeverity()
-
getSourceLocation
public abstract CelSourceLocation getSourceLocation()
-
getMessage
public abstract java.lang.String getMessage()
-
getExprId
public abstract long getExprId()
-
newBuilder
public static CelIssue.Builder newBuilder()
-
formatError
public static CelIssue formatError(long exprId, CelSourceLocation sourceLocation, java.lang.String message)
BuildCelIssue
from the given expression id,CelSourceLocation
, format string, and arguments.
-
formatError
public static CelIssue formatError(CelSourceLocation sourceLocation, java.lang.String message)
BuildCelIssue
from the givenCelSourceLocation
, format string, and arguments.
-
formatError
public static CelIssue formatError(int line, int column, java.lang.String message)
BuildCelIssue
from the given line, column, format string, and arguments.
-
toDisplayString
public static java.lang.String toDisplayString(java.util.Collection<CelIssue> issues, Source source)
Returns a human-readable error with all issues joined in a single string.
-
toDisplayString
public java.lang.String toDisplayString(Source source)
Returns a string representing this error that is suitable for displaying to humans.
-
-