Package dev.cel.common
Class CelValidationResult
- java.lang.Object
-
- dev.cel.common.CelValidationResult
-
@Immutable public final class CelValidationResult extends java.lang.ObjectCelValidationResult encapsulates theCelAbstractSyntaxTreeandCelIssueset which may be generated during the parse and check phases.
-
-
Constructor Summary
Constructors Constructor Description CelValidationResult(CelAbstractSyntaxTree ast, com.google.common.collect.ImmutableList<CelIssue> issues)Internal: Consumers should not be creating an instance of this class on their ownCelValidationResult(CelSource source, com.google.common.collect.ImmutableList<CelIssue> issues)Internal: Consumers should not be creating an instance of this class directly.CelValidationResult(CelSource source, java.lang.Throwable failure, com.google.common.collect.ImmutableList<CelIssue> issues)Internal: Consumers should not be creating an instance of this class directly.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.google.common.collect.ImmutableList<CelIssue>getAllIssues()Return allCelIssues encountered durint validation.CelAbstractSyntaxTreegetAst()Returns the validatedCelAbstractSyntaxTreeif one exists.java.lang.StringgetDebugString()Deprecated.UsegetIssueString()instead.com.google.common.collect.ImmutableList<CelIssue>getErrors()Return the set ofCelIssues with anERRORseverity.java.lang.StringgetErrorString()Convert theCelIssues withERRORseverity to an error string.java.lang.StringgetIssueString()Convert all issues to a human-readable string.CelSourcegetSource()Return theCelSourceassociated with the result.booleanhasError()Whether aCelIssuewith anCelIssue.Severity.ERRORseverity was encountered during validation.
-
-
-
Constructor Detail
-
CelValidationResult
@Internal public CelValidationResult(CelSource source, com.google.common.collect.ImmutableList<CelIssue> issues)
Internal: Consumers should not be creating an instance of this class directly.
-
CelValidationResult
@Internal public CelValidationResult(CelSource source, java.lang.Throwable failure, com.google.common.collect.ImmutableList<CelIssue> issues)
Internal: Consumers should not be creating an instance of this class directly.
-
CelValidationResult
@Internal public CelValidationResult(CelAbstractSyntaxTree ast, com.google.common.collect.ImmutableList<CelIssue> issues)
Internal: Consumers should not be creating an instance of this class on their own
-
-
Method Detail
-
getAst
@CanIgnoreReturnValue public CelAbstractSyntaxTree getAst() throws CelValidationException
Returns the validatedCelAbstractSyntaxTreeif one exists.When
hasErrorreturnstrue, this accessor will throw aCelValidationExceptioncontaining the error set which prevented AST generation.- Throws:
CelValidationException
-
getSource
public CelSource getSource()
Return theCelSourceassociated with the result.
-
hasError
public boolean hasError()
Whether aCelIssuewith anCelIssue.Severity.ERRORseverity was encountered during validation.
-
getErrors
public com.google.common.collect.ImmutableList<CelIssue> getErrors()
Return the set ofCelIssues with anERRORseverity.
-
getAllIssues
public com.google.common.collect.ImmutableList<CelIssue> getAllIssues()
Return allCelIssues encountered durint validation.
-
getIssueString
public java.lang.String getIssueString()
Convert all issues to a human-readable string.
-
getDebugString
@Deprecated @InlineMe(replacement="this.getIssueString()") public java.lang.String getDebugString()
Deprecated.UsegetIssueString()instead.Convert theCelIssueset to a debug string.
-
getErrorString
public java.lang.String getErrorString()
Convert theCelIssues withERRORseverity to an error string.
-
-