class Overload extends Message

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

Methods

__construct(array $data = NULL)

Constructor.

string
getOverloadId()

Required. Globally unique overload name of the function which reflects the function name and argument types.

$this
setOverloadId(string $var)

Required. Globally unique overload name of the function which reflects the function name and argument types.

RepeatedField
getParams()

List of function parameter [Type][google.api.expr.v1alpha1.Type] values.

$this
setParams(Type[]|RepeatedField $var)

List of function parameter [Type][google.api.expr.v1alpha1.Type] values.

RepeatedField
getTypeParams()

The type param names associated with the function declaration.

$this
setTypeParams(string[]|RepeatedField $var)

The type param names associated with the function declaration.

getResultType()

Required. The result type of the function. For example, the operator string.isEmpty() would have result_type of kind: BOOL.

$this
setResultType(Type $var)

Required. The result type of the function. For example, the operator string.isEmpty() would have result_type of kind: BOOL.

bool
getIsInstanceFunction()

Whether the function is to be used in a method call-style `x.f(.

$this
setIsInstanceFunction(bool $var)

Whether the function is to be used in a method call-style `x.f(.

string
getDoc()

Documentation string for the overload.

$this
setDoc(string $var)

Documentation string for the overload.

Details

at line 114
__construct(array $data = NULL)

Constructor.

Parameters

array $data { 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 \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 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(...)`
      of 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.

}

at line 128
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][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;

Return Value

string

at line 143
$this setOverloadId(string $var)

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.

Generated from protobuf field string overload_id = 1;

Parameters

string $var

Return Value

$this

at line 164
RepeatedField getParams()

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.

Generated from protobuf field repeated .google.api.expr.v1alpha1.Type params = 2;

Return Value

RepeatedField

at line 183
$this setParams(Type[]|RepeatedField $var)

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.

Generated from protobuf field repeated .google.api.expr.v1alpha1.Type params = 2;

Parameters

Type[]|RepeatedField $var

Return Value

$this

at line 199
RepeatedField getTypeParams()

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.

Generated from protobuf field repeated string type_params = 3;

Return Value

RepeatedField

at line 213
$this setTypeParams(string[]|RepeatedField $var)

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.

Generated from protobuf field repeated string type_params = 3;

Parameters

string[]|RepeatedField $var

Return Value

$this

at line 228
Type getResultType()

Required. The result type of the function. For example, the operator string.isEmpty() would have result_type of kind: BOOL.

Generated from protobuf field .google.api.expr.v1alpha1.Type result_type = 4;

Return Value

Type

at line 241
$this setResultType(Type $var)

Required. The result type of the function. For example, the operator string.isEmpty() would have result_type of kind: BOOL.

Generated from protobuf field .google.api.expr.v1alpha1.Type result_type = 4;

Parameters

Type $var

Return Value

$this

at line 258
bool getIsInstanceFunction()

Whether the function is to be used in a method call-style `x.f(.

..)of a function call-stylef(x, ...). 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;

Return Value

bool

at line 273
$this setIsInstanceFunction(bool $var)

Whether the function is to be used in a method call-style `x.f(.

..)of a function call-stylef(x, ...). 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;

Parameters

bool $var

Return Value

$this

at line 287
string getDoc()

Documentation string for the overload.

Generated from protobuf field string doc = 6;

Return Value

string

at line 299
$this setDoc(string $var)

Documentation string for the overload.

Generated from protobuf field string doc = 6;

Parameters

string $var

Return Value

$this