Overload
extends Message
in package
An overload indicates a function's parameter types and return type, and may optionally include a function body described in terms of [Expr][google.api.expr.v1alpha1.Expr] values.
Functions overloads are declared in either a function or method
call-style. For methods, the params[0] is the expected type of the
target receiver.
Overloads must have non-overlapping argument types after erasure of all
parameterized type variables (similar as type erasure in Java).
Generated from protobuf message google.api.expr.v1alpha1.Decl.FunctionDecl.Overload
Table of Contents
Properties
- $doc : mixed
- Documentation string for the overload.
- $is_instance_function : mixed
- Whether the function is to be used in a method call-style `x.f(...)` or a function call-style `f(x, ...)`.
- $overload_id : mixed
- Required. Globally unique overload name of the function which reflects the function name and argument types.
- $result_type : mixed
- Required. The result type of the function. For example, the operator `string.isEmpty()` would have `result_type` of `kind: BOOL`.
- $params : mixed
- List of function parameter [Type][google.api.expr.v1alpha1.Type] values.
- $type_params : mixed
- The type param names associated with the function declaration.
Methods
- __construct() : mixed
- Constructor.
- clearResultType() : mixed
- getDoc() : string
- Documentation string for the overload.
- getIsInstanceFunction() : bool
- Whether the function is to be used in a method call-style `x.f(...)` or a function call-style `f(x, ...)`.
- getOverloadId() : string
- Required. Globally unique overload name of the function which reflects the function name and argument types.
- getParams() : RepeatedField
- List of function parameter [Type][google.api.expr.v1alpha1.Type] values.
- getResultType() : Type|null
- Required. The result type of the function. For example, the operator `string.isEmpty()` would have `result_type` of `kind: BOOL`.
- getTypeParams() : RepeatedField
- The type param names associated with the function declaration.
- hasResultType() : mixed
- setDoc() : $this
- Documentation string for the overload.
- setIsInstanceFunction() : $this
- Whether the function is to be used in a method call-style `x.f(...)` or a function call-style `f(x, ...)`.
- setOverloadId() : $this
- Required. Globally unique overload name of the function which reflects the function name and argument types.
- setParams() : $this
- List of function parameter [Type][google.api.expr.v1alpha1.Type] values.
- setResultType() : $this
- Required. The result type of the function. For example, the operator `string.isEmpty()` would have `result_type` of `kind: BOOL`.
- setTypeParams() : $this
- The type param names associated with the function declaration.
Properties
$doc
Documentation string for the overload.
protected
mixed
$doc
= ''
Generated from protobuf field string doc = 6 [json_name = "doc"];
$is_instance_function
Whether the function is to be used in a method call-style `x.f(...)` or a function call-style `f(x, ...)`.
protected
mixed
$is_instance_function
= false
For methods, the first parameter declaration, params[0] is the
expected type of the target receiver.
Generated from protobuf field bool is_instance_function = 5 [json_name = "isInstanceFunction"];
$overload_id
Required. Globally unique overload name of the function which reflects the function name and argument types.
protected
mixed
$overload_id
= ''
This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
to indicate the overload_id that was resolved for the function
name.
Generated from protobuf field string overload_id = 1 [json_name = "overloadId"];
$result_type
Required. The result type of the function. For example, the operator `string.isEmpty()` would have `result_type` of `kind: BOOL`.
protected
mixed
$result_type
= null
Generated from protobuf field .google.api.expr.v1alpha1.Type result_type = 4 [json_name = "resultType"];
$params
List of function parameter [Type][google.api.expr.v1alpha1.Type] values.
private
mixed
$params
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.
Generated from protobuf field repeated .google.api.expr.v1alpha1.Type params = 2 [json_name = "params"];
$type_params
The type param names associated with the function declaration.
private
mixed
$type_params
For example, function ex<K,V>(K key, map<K, V> map) : V would yield
the type params of K, V.
Generated from protobuf field repeated string type_params = 3 [json_name = "typeParams"];
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $data = NULL ]) : mixed
Parameters
- $data : array<string|int, mixed> = NULL
-
{ Optional. Data for populating the Message object.
@type string $overload_id Required. Globally unique overload name of the function which reflects the function name and argument types. This will be used by a [Reference][google.api.expr.v1alpha1.Reference] to indicate the `overload_id` that was resolved for the function `name`. @type array<\Google\Api\Expr\V1alpha1\Type>|\Google\Protobuf\Internal\RepeatedField $params List of function parameter [Type][google.api.expr.v1alpha1.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. @type array<string>|\Google\Protobuf\Internal\RepeatedField $type_params 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`. @type \Google\Api\Expr\V1alpha1\Type $result_type Required. The result type of the function. For example, the operator `string.isEmpty()` would have `result_type` of `kind: BOOL`. @type bool $is_instance_function Whether the function is to be used in a method call-style `x.f(...)` or a function call-style `f(x, ...)`. For methods, the first parameter declaration, `params[0]` is the expected type of the target receiver. @type string $doc Documentation string for the overload.}
clearResultType()
public
clearResultType() : mixed
getDoc()
Documentation string for the overload.
public
getDoc() : string
Generated from protobuf field string doc = 6 [json_name = "doc"];
Return values
stringgetIsInstanceFunction()
Whether the function is to be used in a method call-style `x.f(...)` or a function call-style `f(x, ...)`.
public
getIsInstanceFunction() : bool
For methods, the first parameter declaration, params[0] is the
expected type of the target receiver.
Generated from protobuf field bool is_instance_function = 5 [json_name = "isInstanceFunction"];
Return values
boolgetOverloadId()
Required. Globally unique overload name of the function which reflects the function name and argument types.
public
getOverloadId() : string
This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
to indicate the overload_id that was resolved for the function
name.
Generated from protobuf field string overload_id = 1 [json_name = "overloadId"];
Return values
stringgetParams()
List of function parameter [Type][google.api.expr.v1alpha1.Type] values.
public
getParams() : RepeatedField
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.
Generated from protobuf field repeated .google.api.expr.v1alpha1.Type params = 2 [json_name = "params"];
Return values
RepeatedFieldgetResultType()
Required. The result type of the function. For example, the operator `string.isEmpty()` would have `result_type` of `kind: BOOL`.
public
getResultType() : Type|null
Generated from protobuf field .google.api.expr.v1alpha1.Type result_type = 4 [json_name = "resultType"];
Return values
Type|nullgetTypeParams()
The type param names associated with the function declaration.
public
getTypeParams() : RepeatedField
For example, function ex<K,V>(K key, map<K, V> map) : V would yield
the type params of K, V.
Generated from protobuf field repeated string type_params = 3 [json_name = "typeParams"];
Return values
RepeatedFieldhasResultType()
public
hasResultType() : mixed
setDoc()
Documentation string for the overload.
public
setDoc(string $var) : $this
Generated from protobuf field string doc = 6 [json_name = "doc"];
Parameters
- $var : string
Return values
$thissetIsInstanceFunction()
Whether the function is to be used in a method call-style `x.f(...)` or a function call-style `f(x, ...)`.
public
setIsInstanceFunction(bool $var) : $this
For methods, the first parameter declaration, params[0] is the
expected type of the target receiver.
Generated from protobuf field bool is_instance_function = 5 [json_name = "isInstanceFunction"];
Parameters
- $var : bool
Return values
$thissetOverloadId()
Required. Globally unique overload name of the function which reflects the function name and argument types.
public
setOverloadId(string $var) : $this
This will be used by a [Reference][google.api.expr.v1alpha1.Reference]
to indicate the overload_id that was resolved for the function
name.
Generated from protobuf field string overload_id = 1 [json_name = "overloadId"];
Parameters
- $var : string
Return values
$thissetParams()
List of function parameter [Type][google.api.expr.v1alpha1.Type] values.
public
setParams(array<string|int, Type>|RepeatedField $var) : $this
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.
Generated from protobuf field repeated .google.api.expr.v1alpha1.Type params = 2 [json_name = "params"];
Parameters
- $var : array<string|int, Type>|RepeatedField
Return values
$thissetResultType()
Required. The result type of the function. For example, the operator `string.isEmpty()` would have `result_type` of `kind: BOOL`.
public
setResultType(Type $var) : $this
Generated from protobuf field .google.api.expr.v1alpha1.Type result_type = 4 [json_name = "resultType"];
Parameters
- $var : Type
Return values
$thissetTypeParams()
The type param names associated with the function declaration.
public
setTypeParams(array<string|int, string>|RepeatedField $var) : $this
For example, function ex<K,V>(K key, map<K, V> map) : V would yield
the type params of K, V.
Generated from protobuf field repeated string type_params = 3 [json_name = "typeParams"];
Parameters
- $var : array<string|int, string>|RepeatedField