Class CelOverloadDecl


  • @Immutable
    public abstract class CelOverloadDecl
    extends java.lang.Object
    Abstract representation of a CEL function overload declaration.

    An overload indicates a function's parameter types and return type, where types are specified via CEL native type representations (See: CelType.

    An overload is declared in either a global function `Ex: f(x, ...)` or a method call style `Ex: x.f(...)`.

    • Constructor Detail

      • CelOverloadDecl

        public CelOverloadDecl()
    • Method Detail

      • overloadId

        public abstract java.lang.String overloadId()
        Required. Globally unique overload name.
      • parameterTypes

        public abstract com.google.common.collect.ImmutableList<CelType> parameterTypes()
        List of function parameter type values.

        Param types are disjoint after generic type parameters have been replaced with the type `DYN`. Since the `DYN` type is compatible with any other type, this means that if `A` is a type parameter, the function types `int` and `int` are not disjoint. Likewise, `map` is not disjoint from `map`.

        When the resultType() of a function is a generic type param, the type param name also appears as the `type` of on at least one params.

      • typeParameterNames

        public abstract com.google.common.collect.ImmutableSet<java.lang.String> typeParameterNames()
        The type param names associated with the function declaration.
      • resultType

        public abstract CelType resultType()
        Required. The result type of the function. For example, the operator `string.isEmpty()` would have `result_type` of `CelKind.BOOL`.
      • isInstanceFunction

        public abstract boolean isInstanceFunction()
        Denotes whether the function is declared in a global function `Ex: f(x, ...)` or a method call style `Ex: x.f(...)`.
      • doc

        public abstract java.lang.String doc()
        Documentation string for the overload.
      • newMemberOverload

        @CheckReturnValue
        public static CelOverloadDecl newMemberOverload​(java.lang.String overloadId,
                                                        CelType resultType,
                                                        CelType... paramTypes)
        Helper method for declaring a member function overload
      • newMemberOverload

        @CheckReturnValue
        public static CelOverloadDecl newMemberOverload​(java.lang.String overloadId,
                                                        CelType resultType,
                                                        java.util.List<CelType> paramTypes)
        Helper method for declaring a member function overload
      • newMemberOverload

        @CheckReturnValue
        public static CelOverloadDecl newMemberOverload​(java.lang.String overloadId,
                                                        java.lang.String doc,
                                                        CelType resultType,
                                                        CelType... paramTypes)
        Helper method for declaring a member function overload
      • newMemberOverload

        @CheckReturnValue
        public static CelOverloadDecl newMemberOverload​(java.lang.String overloadId,
                                                        java.lang.String doc,
                                                        CelType resultType,
                                                        java.util.List<CelType> paramTypes)
        Helper method for declaring a member function overload
      • newGlobalOverload

        @CheckReturnValue
        public static CelOverloadDecl newGlobalOverload​(java.lang.String overloadId,
                                                        CelType resultType,
                                                        CelType... paramTypes)
        Helper method for declaring a global function overload
      • newGlobalOverload

        @CheckReturnValue
        public static CelOverloadDecl newGlobalOverload​(java.lang.String overloadId,
                                                        CelType resultType,
                                                        java.util.List<CelType> paramTypes)
        Helper method for declaring a global function overload
      • newGlobalOverload

        @CheckReturnValue
        public static CelOverloadDecl newGlobalOverload​(java.lang.String overloadId,
                                                        java.lang.String doc,
                                                        CelType resultType,
                                                        CelType... paramTypes)
        Helper method for declaring a global function overload
      • newGlobalOverload

        @CheckReturnValue
        public static CelOverloadDecl newGlobalOverload​(java.lang.String overloadId,
                                                        java.lang.String doc,
                                                        CelType resultType,
                                                        java.util.List<CelType> paramTypes)
        Helper method for declaring a global function overload