Package dev.cel.common
Class CelSource.Builder
- java.lang.Object
-
- dev.cel.common.CelSource.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CelSource.Builder
addAllExtensions(CelSource.Extension... extensions)
Adds one or moreCelSource.Extension
s to the source information.CelSource.Builder
addAllExtensions(java.lang.Iterable<? extends CelSource.Extension> extensions)
Adds one or moreCelSource.Extension
s to the source information.CelSource.Builder
addAllLineOffsets(java.lang.Iterable<java.lang.Integer> lineOffsets)
CelSource.Builder
addAllMacroCalls(java.util.Map<java.lang.Long,CelExpr> macroCalls)
CelSource.Builder
addLineOffsets(int lineOffset)
CelSource.Builder
addMacroCalls(long exprId, CelExpr expr)
CelSource.Builder
addPositions(long exprId, int position)
CelSource.Builder
addPositionsMap(java.util.Map<java.lang.Long,java.lang.Integer> positionsMap)
CelSource
build()
boolean
containsMacroCalls(long exprId)
com.google.common.collect.ImmutableSet<CelSource.Extension>
getExtensions()
java.util.Optional<java.lang.Integer>
getLocationOffset(int line, int column)
Get the code point offset within the source expression text that corresponds with theline
andcolumn
.java.util.Optional<java.lang.Integer>
getLocationOffset(CelSourceLocation location)
java.util.Map<java.lang.Long,CelExpr>
getMacroCalls()
java.util.Optional<CelSourceLocation>
getOffsetLocation(int offset)
Get the line and column in the source expression text for the given code pointoffset
.java.util.Map<java.lang.Long,java.lang.Integer>
getPositionsMap()
CelSource.Builder
removePositions(long exprId)
CelSource.Builder
setDescription(java.lang.String description)
-
-
-
Method Detail
-
setDescription
@CanIgnoreReturnValue public CelSource.Builder setDescription(java.lang.String description)
-
addLineOffsets
@CanIgnoreReturnValue public CelSource.Builder addLineOffsets(int lineOffset)
-
addAllLineOffsets
@CanIgnoreReturnValue public CelSource.Builder addAllLineOffsets(java.lang.Iterable<java.lang.Integer> lineOffsets)
-
addPositionsMap
@CanIgnoreReturnValue public CelSource.Builder addPositionsMap(java.util.Map<java.lang.Long,java.lang.Integer> positionsMap)
-
addPositions
@CanIgnoreReturnValue public CelSource.Builder addPositions(long exprId, int position)
-
removePositions
@CanIgnoreReturnValue public CelSource.Builder removePositions(long exprId)
-
addMacroCalls
@CanIgnoreReturnValue public CelSource.Builder addMacroCalls(long exprId, CelExpr expr)
-
addAllMacroCalls
@CanIgnoreReturnValue public CelSource.Builder addAllMacroCalls(java.util.Map<java.lang.Long,CelExpr> macroCalls)
-
getExtensions
public com.google.common.collect.ImmutableSet<CelSource.Extension> getExtensions()
-
addAllExtensions
@CanIgnoreReturnValue public CelSource.Builder addAllExtensions(java.lang.Iterable<? extends CelSource.Extension> extensions)
Adds one or moreCelSource.Extension
s to the source information. Extensions implement set semantics and deduped if same ones are provided.
-
addAllExtensions
@CanIgnoreReturnValue public CelSource.Builder addAllExtensions(CelSource.Extension... extensions)
Adds one or moreCelSource.Extension
s to the source information. Extensions implement set semantics and deduped if same ones are provided.
-
getLocationOffset
public java.util.Optional<java.lang.Integer> getLocationOffset(CelSourceLocation location)
-
getLocationOffset
public java.util.Optional<java.lang.Integer> getLocationOffset(int line, int column)
Get the code point offset within the source expression text that corresponds with theline
andcolumn
.- Parameters:
line
- the line number starting from 1column
- the column number starting from 0
-
getOffsetLocation
public java.util.Optional<CelSourceLocation> getOffsetLocation(int offset)
Get the line and column in the source expression text for the given code pointoffset
.
-
getPositionsMap
@CheckReturnValue public java.util.Map<java.lang.Long,java.lang.Integer> getPositionsMap()
-
getMacroCalls
@CheckReturnValue public java.util.Map<java.lang.Long,CelExpr> getMacroCalls()
-
containsMacroCalls
@CheckReturnValue public boolean containsMacroCalls(long exprId)
-
build
@CheckReturnValue public CelSource build()
-
-