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.BuilderaddAllExtensions(CelSource.Extension... extensions)Adds one or moreCelSource.Extensions to the source information.CelSource.BuilderaddAllExtensions(java.lang.Iterable<? extends CelSource.Extension> extensions)Adds one or moreCelSource.Extensions to the source information.CelSource.BuilderaddAllLineOffsets(java.lang.Iterable<java.lang.Integer> lineOffsets)CelSource.BuilderaddAllMacroCalls(java.util.Map<java.lang.Long,CelExpr> macroCalls)CelSource.BuilderaddLineOffsets(int lineOffset)CelSource.BuilderaddMacroCalls(long exprId, CelExpr expr)CelSource.BuilderaddPositions(long exprId, int position)CelSource.BuilderaddPositionsMap(java.util.Map<java.lang.Long,java.lang.Integer> positionsMap)CelSourcebuild()booleancontainsMacroCalls(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 thelineandcolumn.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.BuilderremovePositions(long exprId)CelSource.BuildersetDescription(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.Extensions 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.Extensions 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 thelineandcolumn.- 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()
-
-