Class CelSource.Builder

  • Enclosing class:
    CelSource

    public static final class CelSource.Builder
    extends java.lang.Object
    Builder for CelSource.
    • 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)
      • 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 more CelSource.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​(int line,
                                                                       int column)
        Get the code point offset within the source expression text that corresponds with the line and column.
        Parameters:
        line - the line number starting from 1
        column - 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 point offset.
      • 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()