SPeCS Packages Documentation
Preparing search index...
@specs-feup/kadabra
kadabra/adapt/Specializer
ExtractToField
Function ExtractToField
ExtractToField
(
$call
:
Call
|
null
|
undefined
,
$method
:
Method
|
null
|
undefined
,
$fieldLocation
:
Class
|
null
|
undefined
,
newFile
?:
boolean
,
$funcInterface
?:
InterfaceType
|
null
|
undefined
,
)
:
|
{
$field
:
null
;
$interface
:
InterfaceType
|
null
;
$interfaceMethod
:
undefined
;
defaultMethod
:
undefined
;
}
|
{
$field
:
Field
|
undefined
;
$interface
:
InterfaceType
;
$interfaceMethod
:
Method
|
undefined
;
defaultMethod
:
string
;
}
|
{
$field
:
undefined
;
$interface
:
undefined
;
$interfaceMethod
:
undefined
;
defaultMethod
:
undefined
;
}
Prepares a given method call by:
extracting a functional interface
create a field of that type
initialize the field with the called method
replace the call with invocation of the field method
NOTE: This is an alias for "PrepareCall" aspect
Parameters
$call
:
Call
|
null
|
undefined
$method
:
Method
|
null
|
undefined
$fieldLocation
:
Class
|
null
|
undefined
newFile
:
boolean
= true
$funcInterface
:
InterfaceType
|
null
|
undefined
= null
Returns
|
{
$field
:
null
;
$interface
:
InterfaceType
|
null
;
$interfaceMethod
:
undefined
;
defaultMethod
:
undefined
;
}
|
{
$field
:
Field
|
undefined
;
$interface
:
InterfaceType
;
$interfaceMethod
:
Method
|
undefined
;
defaultMethod
:
string
;
}
|
{
$field
:
undefined
;
$interface
:
undefined
;
$interfaceMethod
:
undefined
;
defaultMethod
:
undefined
;
}
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
SPeCS Packages Documentation
Loading...
Prepares a given method call by:
NOTE: This is an alias for "PrepareCall" aspect