Class CelExprFactory

  • Direct Known Subclasses:
    CelMacroExprFactory

    @Internal
    public class CelExprFactory
    extends java.lang.Object
    Factory for generating expression nodes.
    • Constructor Detail

      • CelExprFactory

        protected CelExprFactory()
    • Method Detail

      • newConstant

        public final CelExpr newConstant​(CelConstant constant)
        Create a new constant expression.
      • newBoolLiteral

        public final CelExpr newBoolLiteral​(boolean value)
        Creates a new constant CelExpr for a bool value.
      • newBytesLiteral

        public final CelExpr newBytesLiteral​(java.lang.String value)
        Creates a new constant CelExpr for a bytes value.
      • newBytesLiteral

        public final CelExpr newBytesLiteral​(byte[] value)
        Creates a new constant CelExpr for a bytes value.
      • newDoubleLiteral

        public final CelExpr newDoubleLiteral​(double value)
        Creates a new constant CelExpr for a double value.
      • newIntLiteral

        public final CelExpr newIntLiteral​(long value)
        Creates a new constant CelExpr for an int value.
      • newStringLiteral

        public final CelExpr newStringLiteral​(java.lang.String value)
        Creates a new constant CelExpr for a string value.
      • newUintLiteral

        public final CelExpr newUintLiteral​(long value)
        Creates a new constant CelExpr for a uint value.
      • newList

        public final CelExpr newList​(CelExpr... elements)
        Creates a new list CelExpr comprised of the elements.
      • newList

        public final CelExpr newList​(java.lang.Iterable<CelExpr> elements)
        Creates a new list CelExpr comprised of the elements.
      • newMessage

        public final CelExpr newMessage​(java.lang.String typeName,
                                        CelExpr.CelStruct.Entry... fields)
        Creates a new message CelExpr of the given type comprised of the given fields.
      • newMessage

        public final CelExpr newMessage​(java.lang.String typeName,
                                        java.lang.Iterable<CelExpr.CelStruct.Entry> fields)
        Creates a new message CelExpr of the given type comprised of the given fields.
      • fold

        public final CelExpr fold​(java.lang.String iterVar,
                                  CelExpr iterRange,
                                  java.lang.String accuVar,
                                  CelExpr accuInit,
                                  CelExpr condition,
                                  CelExpr step,
                                  CelExpr result)
        Fold creates a fold for one variable comprehension instruction.
      • fold

        public final CelExpr fold​(java.lang.String iterVar,
                                  java.lang.String iterVar2,
                                  CelExpr iterRange,
                                  java.lang.String accuVar,
                                  CelExpr accuInit,
                                  CelExpr condition,
                                  CelExpr step,
                                  CelExpr result)
        Fold creates a fold for two variable comprehension instruction.
      • newIdentifier

        public final CelExpr newIdentifier​(java.lang.String name)
        Creates an identifier CelExpr for the given name.
      • newGlobalCall

        public final CelExpr newGlobalCall​(java.lang.String function,
                                           CelExpr... arguments)
        Creates a global (free) function call CelExpr for the given function and arguments.
      • newGlobalCall

        public final CelExpr newGlobalCall​(java.lang.String function,
                                           java.lang.Iterable<CelExpr> arguments)
        Creates a global (free) function call CelExpr for the given function and arguments.
      • newReceiverCall

        public final CelExpr newReceiverCall​(java.lang.String function,
                                             CelExpr target,
                                             CelExpr... arguments)
        Creates a receiver-style function call CelExpr for the given function, target, and arguments.
      • newReceiverCall

        public final CelExpr newReceiverCall​(java.lang.String function,
                                             CelExpr target,
                                             java.lang.Iterable<CelExpr> arguments)
        Creates a receiver-style function call CelExpr for the given function, target, and arguments.
      • newSelect

        public final CelExpr newSelect​(CelExpr operand,
                                       java.lang.String field,
                                       boolean testOnly)
        Creates a field traversal or field presence test CelExpr for the given operand and field.
      • nextExprId

        protected long nextExprId()
        Returns the next unique expression ID.
      • maybeDeleteId

        protected void maybeDeleteId​(long id)
        Attempts to decrement the next expr ID if possible.