gravitino.api.function.function_change.UpdateImpl¶
- class gravitino.api.function.function_change.UpdateImpl(parameters: List[FunctionParam], runtime: RuntimeType, implementation: FunctionImpl)¶
Bases:
FunctionChangeA FunctionChange to replace an implementation for a specific definition.
- __init__(parameters: List[FunctionParam], runtime: RuntimeType, implementation: FunctionImpl)¶
Methods
__init__(parameters, runtime, implementation)add_definition(definition)Create a FunctionChange to add a new definition (overload) to a function.
add_impl(parameters, implementation)Create a FunctionChange to add an implementation to a specific definition.
Returns the new implementation.
Returns the parameters that identify the definition to update.
remove_definition(parameters)Create a FunctionChange to remove an existing definition from a function.
remove_impl(parameters, runtime)Create a FunctionChange to remove an implementation for a specific definition.
runtime()Returns the runtime that identifies the implementation to replace.
update_comment(new_comment)Create a FunctionChange to update the comment of a function.
update_impl(parameters, runtime, implementation)Create a FunctionChange to update an implementation for a specific definition.
Attributes
An empty list of parameters.
- EMPTY_PARAMS: List[FunctionParam] = []¶
An empty list of parameters.
- static add_definition(definition: FunctionDefinition) FunctionChange¶
Create a FunctionChange to add a new definition (overload) to a function.
- Args:
definition: The new definition to add.
- Returns:
The change instance.
- static add_impl(parameters: List[FunctionParam], implementation: FunctionImpl) FunctionChange¶
Create a FunctionChange to add an implementation to a specific definition.
- Args:
parameters: The parameters that identify the definition to update. implementation: The implementation to add.
- Returns:
The change instance.
- implementation() FunctionImpl¶
Returns the new implementation.
- parameters() List[FunctionParam]¶
Returns the parameters that identify the definition to update.
- static remove_definition(parameters: List[FunctionParam]) FunctionChange¶
Create a FunctionChange to remove an existing definition from a function.
- Args:
parameters: The parameters that identify the definition to remove.
- Returns:
The change instance.
- static remove_impl(parameters: List[FunctionParam], runtime: RuntimeType) FunctionChange¶
Create a FunctionChange to remove an implementation for a specific definition.
- Args:
parameters: The parameters that identify the definition to update. runtime: The runtime that identifies the implementation to remove.
- Returns:
The change instance.
- runtime() RuntimeType¶
Returns the runtime that identifies the implementation to replace.
- static update_comment(new_comment: str) FunctionChange¶
Create a FunctionChange to update the comment of a function.
- Args:
new_comment: The new comment value.
- Returns:
The change instance.
- static update_impl(parameters: List[FunctionParam], runtime: RuntimeType, implementation: FunctionImpl) FunctionChange¶
Create a FunctionChange to update an implementation for a specific definition.
- Args:
parameters: The parameters that identify the definition to update. runtime: The runtime that identifies the implementation to replace. implementation: The new implementation.
- Returns:
The change instance.