Package dev.cel.expr

Class Decl.FunctionDecl.Overload.Builder

    • Method Detail

      • getDefaultInstanceForType

        public Decl.FunctionDecl.Overload getDefaultInstanceForType()
        Description copied from interface: MessageLiteOrBuilder
        Get an instance of the type with no fields set. Because no fields are set, all getters for singular fields will return default values and repeated fields will appear empty. This may or may not be a singleton. This differs from the getDefaultInstance() method of generated message classes in that this method is an abstract method of the MessageLite interface whereas getDefaultInstance() is a static method of a specific class. They return the same thing.
        Specified by:
        getDefaultInstanceForType in interface MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface MessageOrBuilder
      • mergeFrom

        public Decl.FunctionDecl.Overload.Builder mergeFrom​(Message other)
        Description copied from interface: Message.Builder
        Merge other into the message being built. other must have the exact same type as this (i.e. getDescriptorForType() == other.getDescriptorForType()).

        Merging occurs as follows. For each field:
        * For singular primitive fields, if the field is set in other, then other's value overwrites the value in this message.
        * For singular message fields, if the field is set in other, it is merged into the corresponding sub-message of this message using the same merging rules.
        * For repeated fields, the elements in other are concatenated with the elements in this message.
        * For oneof groups, if the other message has one of the fields set, the group of this message is cleared and replaced by the field of the other message, so that the oneof constraint is preserved.

        This is equivalent to the Message::MergeFrom method in C++.

        Specified by:
        mergeFrom in interface Message.Builder
        Overrides:
        mergeFrom in class AbstractMessage.Builder<Decl.FunctionDecl.Overload.Builder>
      • getOverloadId

        public java.lang.String getOverloadId()
         Required. Globally unique overload name of the function which reflects
         the function name and argument types.
         This will be used by a [Reference][cel.expr.Reference] to
         indicate the `overload_id` that was resolved for the function `name`.
         
        string overload_id = 1;
        Specified by:
        getOverloadId in interface Decl.FunctionDecl.OverloadOrBuilder
        Returns:
        The overloadId.
      • getOverloadIdBytes

        public ByteString getOverloadIdBytes()
         Required. Globally unique overload name of the function which reflects
         the function name and argument types.
         This will be used by a [Reference][cel.expr.Reference] to
         indicate the `overload_id` that was resolved for the function `name`.
         
        string overload_id = 1;
        Specified by:
        getOverloadIdBytes in interface Decl.FunctionDecl.OverloadOrBuilder
        Returns:
        The bytes for overloadId.
      • setOverloadId

        public Decl.FunctionDecl.Overload.Builder setOverloadId​(java.lang.String value)
         Required. Globally unique overload name of the function which reflects
         the function name and argument types.
         This will be used by a [Reference][cel.expr.Reference] to
         indicate the `overload_id` that was resolved for the function `name`.
         
        string overload_id = 1;
        Parameters:
        value - The overloadId to set.
        Returns:
        This builder for chaining.
      • clearOverloadId

        public Decl.FunctionDecl.Overload.Builder clearOverloadId()
         Required. Globally unique overload name of the function which reflects
         the function name and argument types.
         This will be used by a [Reference][cel.expr.Reference] to
         indicate the `overload_id` that was resolved for the function `name`.
         
        string overload_id = 1;
        Returns:
        This builder for chaining.
      • setOverloadIdBytes

        public Decl.FunctionDecl.Overload.Builder setOverloadIdBytes​(ByteString value)
         Required. Globally unique overload name of the function which reflects
         the function name and argument types.
         This will be used by a [Reference][cel.expr.Reference] to
         indicate the `overload_id` that was resolved for the function `name`.
         
        string overload_id = 1;
        Parameters:
        value - The bytes for overloadId to set.
        Returns:
        This builder for chaining.
      • getParamsList

        public java.util.List<Type> getParamsList()
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
        Specified by:
        getParamsList in interface Decl.FunctionDecl.OverloadOrBuilder
      • getParamsCount

        public int getParamsCount()
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
        Specified by:
        getParamsCount in interface Decl.FunctionDecl.OverloadOrBuilder
      • getParams

        public Type getParams​(int index)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
        Specified by:
        getParams in interface Decl.FunctionDecl.OverloadOrBuilder
      • setParams

        public Decl.FunctionDecl.Overload.Builder setParams​(int index,
                                                            Type value)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • setParams

        public Decl.FunctionDecl.Overload.Builder setParams​(int index,
                                                            Type.Builder builderForValue)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • addParams

        public Decl.FunctionDecl.Overload.Builder addParams​(Type value)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • addParams

        public Decl.FunctionDecl.Overload.Builder addParams​(int index,
                                                            Type value)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • addParams

        public Decl.FunctionDecl.Overload.Builder addParams​(Type.Builder builderForValue)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • addParams

        public Decl.FunctionDecl.Overload.Builder addParams​(int index,
                                                            Type.Builder builderForValue)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • addAllParams

        public Decl.FunctionDecl.Overload.Builder addAllParams​(java.lang.Iterable<? extends Type> values)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • clearParams

        public Decl.FunctionDecl.Overload.Builder clearParams()
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • removeParams

        public Decl.FunctionDecl.Overload.Builder removeParams​(int index)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • getParamsBuilder

        public Type.Builder getParamsBuilder​(int index)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • getParamsOrBuilder

        public TypeOrBuilder getParamsOrBuilder​(int index)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
        Specified by:
        getParamsOrBuilder in interface Decl.FunctionDecl.OverloadOrBuilder
      • getParamsOrBuilderList

        public java.util.List<? extends TypeOrBuilder> getParamsOrBuilderList()
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
        Specified by:
        getParamsOrBuilderList in interface Decl.FunctionDecl.OverloadOrBuilder
      • addParamsBuilder

        public Type.Builder addParamsBuilder()
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • addParamsBuilder

        public Type.Builder addParamsBuilder​(int index)
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • getParamsBuilderList

        public java.util.List<Type.Builder> getParamsBuilderList()
         List of function parameter [Type][cel.expr.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<A>` and `int<int>` are not disjoint. Likewise,
         `map<string, string>` is not disjoint from `map<K, V>`.
         When the `result_type` of a function is a generic type param, the
         type param name also appears as the `type` of on at least one params.
         
        repeated .cel.expr.Type params = 2;
      • getTypeParamsList

        public ProtocolStringList getTypeParamsList()
         The type param names associated with the function declaration.
         For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
         the type params of `K, V`.
         
        repeated string type_params = 3;
        Specified by:
        getTypeParamsList in interface Decl.FunctionDecl.OverloadOrBuilder
        Returns:
        A list containing the typeParams.
      • getTypeParamsCount

        public int getTypeParamsCount()
         The type param names associated with the function declaration.
         For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
         the type params of `K, V`.
         
        repeated string type_params = 3;
        Specified by:
        getTypeParamsCount in interface Decl.FunctionDecl.OverloadOrBuilder
        Returns:
        The count of typeParams.
      • getTypeParams

        public java.lang.String getTypeParams​(int index)
         The type param names associated with the function declaration.
         For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
         the type params of `K, V`.
         
        repeated string type_params = 3;
        Specified by:
        getTypeParams in interface Decl.FunctionDecl.OverloadOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The typeParams at the given index.
      • getTypeParamsBytes

        public ByteString getTypeParamsBytes​(int index)
         The type param names associated with the function declaration.
         For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
         the type params of `K, V`.
         
        repeated string type_params = 3;
        Specified by:
        getTypeParamsBytes in interface Decl.FunctionDecl.OverloadOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the typeParams at the given index.
      • setTypeParams

        public Decl.FunctionDecl.Overload.Builder setTypeParams​(int index,
                                                                java.lang.String value)
         The type param names associated with the function declaration.
         For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
         the type params of `K, V`.
         
        repeated string type_params = 3;
        Parameters:
        index - The index to set the value at.
        value - The typeParams to set.
        Returns:
        This builder for chaining.
      • addTypeParams

        public Decl.FunctionDecl.Overload.Builder addTypeParams​(java.lang.String value)
         The type param names associated with the function declaration.
         For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
         the type params of `K, V`.
         
        repeated string type_params = 3;
        Parameters:
        value - The typeParams to add.
        Returns:
        This builder for chaining.
      • addAllTypeParams

        public Decl.FunctionDecl.Overload.Builder addAllTypeParams​(java.lang.Iterable<java.lang.String> values)
         The type param names associated with the function declaration.
         For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
         the type params of `K, V`.
         
        repeated string type_params = 3;
        Parameters:
        values - The typeParams to add.
        Returns:
        This builder for chaining.
      • clearTypeParams

        public Decl.FunctionDecl.Overload.Builder clearTypeParams()
         The type param names associated with the function declaration.
         For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
         the type params of `K, V`.
         
        repeated string type_params = 3;
        Returns:
        This builder for chaining.
      • addTypeParamsBytes

        public Decl.FunctionDecl.Overload.Builder addTypeParamsBytes​(ByteString value)
         The type param names associated with the function declaration.
         For example, `function ex<K,V>(K key, map<K, V> map) : V` would yield
         the type params of `K, V`.
         
        repeated string type_params = 3;
        Parameters:
        value - The bytes of the typeParams to add.
        Returns:
        This builder for chaining.
      • hasResultType

        public boolean hasResultType()
         Required. The result type of the function. For example, the operator
         `string.isEmpty()` would have `result_type` of `kind: BOOL`.
         
        .cel.expr.Type result_type = 4;
        Specified by:
        hasResultType in interface Decl.FunctionDecl.OverloadOrBuilder
        Returns:
        Whether the resultType field is set.
      • getResultType

        public Type getResultType()
         Required. The result type of the function. For example, the operator
         `string.isEmpty()` would have `result_type` of `kind: BOOL`.
         
        .cel.expr.Type result_type = 4;
        Specified by:
        getResultType in interface Decl.FunctionDecl.OverloadOrBuilder
        Returns:
        The resultType.
      • setResultType

        public Decl.FunctionDecl.Overload.Builder setResultType​(Type value)
         Required. The result type of the function. For example, the operator
         `string.isEmpty()` would have `result_type` of `kind: BOOL`.
         
        .cel.expr.Type result_type = 4;
      • setResultType

        public Decl.FunctionDecl.Overload.Builder setResultType​(Type.Builder builderForValue)
         Required. The result type of the function. For example, the operator
         `string.isEmpty()` would have `result_type` of `kind: BOOL`.
         
        .cel.expr.Type result_type = 4;
      • mergeResultType

        public Decl.FunctionDecl.Overload.Builder mergeResultType​(Type value)
         Required. The result type of the function. For example, the operator
         `string.isEmpty()` would have `result_type` of `kind: BOOL`.
         
        .cel.expr.Type result_type = 4;
      • clearResultType

        public Decl.FunctionDecl.Overload.Builder clearResultType()
         Required. The result type of the function. For example, the operator
         `string.isEmpty()` would have `result_type` of `kind: BOOL`.
         
        .cel.expr.Type result_type = 4;
      • getResultTypeBuilder

        public Type.Builder getResultTypeBuilder()
         Required. The result type of the function. For example, the operator
         `string.isEmpty()` would have `result_type` of `kind: BOOL`.
         
        .cel.expr.Type result_type = 4;
      • getIsInstanceFunction

        public boolean getIsInstanceFunction()
         Whether the function is to be used in a method call-style `x.f(...)`
         of a function call-style `f(x, ...)`.
         For methods, the first parameter declaration, `params[0]` is the
         expected type of the target receiver.
         
        bool is_instance_function = 5;
        Specified by:
        getIsInstanceFunction in interface Decl.FunctionDecl.OverloadOrBuilder
        Returns:
        The isInstanceFunction.
      • setIsInstanceFunction

        public Decl.FunctionDecl.Overload.Builder setIsInstanceFunction​(boolean value)
         Whether the function is to be used in a method call-style `x.f(...)`
         of a function call-style `f(x, ...)`.
         For methods, the first parameter declaration, `params[0]` is the
         expected type of the target receiver.
         
        bool is_instance_function = 5;
        Parameters:
        value - The isInstanceFunction to set.
        Returns:
        This builder for chaining.
      • clearIsInstanceFunction

        public Decl.FunctionDecl.Overload.Builder clearIsInstanceFunction()
         Whether the function is to be used in a method call-style `x.f(...)`
         of a function call-style `f(x, ...)`.
         For methods, the first parameter declaration, `params[0]` is the
         expected type of the target receiver.
         
        bool is_instance_function = 5;
        Returns:
        This builder for chaining.
      • setDoc

        public Decl.FunctionDecl.Overload.Builder setDoc​(java.lang.String value)
         Documentation string for the overload.
         
        string doc = 6;
        Parameters:
        value - The doc to set.
        Returns:
        This builder for chaining.
      • setDocBytes

        public Decl.FunctionDecl.Overload.Builder setDocBytes​(ByteString value)
         Documentation string for the overload.
         
        string doc = 6;
        Parameters:
        value - The bytes for doc to set.
        Returns:
        This builder for chaining.