Class FunctionType.Builder
java.lang.Object
com.google.javascript.rhino.jstype.FunctionType.Builder
- Enclosing class:
FunctionType
A builder class for function and arrow types.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs a new function type.Make this a constructor.Make this an interface.The ID of the goog.module in which this enum was declared.setIsKnownAmbiguous(boolean x) Sets theClosurePrimitivecorresponding to this functionwithConstructorTemplateKeys(Iterable<TemplateType> constructorOnlyKeys) Specifies a subset of the template keys that only apply to the constructor, and should be removed from the instance type.withInferredReturnType(JSType returnType) Sets an inferred return type.withIsAbstract(boolean isAbstract) Mark abstract method.Set the name of the function type.Set the function to take zero parameters.withParameters(List<FunctionType.Parameter> parameters) Set the parameters of the function type.withPrototypeBasedOn(ObjectType setPrototypeBasedOn) Set the prototype property of a constructor.withReturnType(JSType returnType) Set the return type.withReturnType(JSType returnType, boolean inferred) Set the return type and whether it's inferred.withSourceNode(Node sourceNode) Set the source node of the function type.withTemplateKeys(com.google.common.collect.ImmutableList<TemplateType> templateKeys) Set the template name.withTemplateKeys(TemplateType... templateKeys) Set the template name.withTypeOfThis(JSType typeOfThis) Set the "this" type.
-
Method Details
-
withName
Set the name of the function type. -
withSourceNode
Set the source node of the function type. -
setGoogModuleId
The ID of the goog.module in which this enum was declared. -
withParameters
Set the parameters of the function type. -
withParameters
Set the function to take zero parameters. -
withReturnType
Set the return type. -
withReturnType
Set the return type and whether it's inferred. -
withInferredReturnType
Sets an inferred return type. -
withTypeOfThis
Set the "this" type. -
withTemplateKeys
public FunctionType.Builder withTemplateKeys(com.google.common.collect.ImmutableList<TemplateType> templateKeys) Set the template name. -
withTemplateKeys
Set the template name. -
withConstructorTemplateKeys
Specifies a subset of the template keys that only apply to the constructor, and should be removed from the instance type. These keys must still be passed towithTemplateKeys(com.google.common.collect.ImmutableList<com.google.javascript.rhino.jstype.TemplateType>). -
forConstructor
Make this a constructor. -
forInterface
Make this an interface. -
withIsAbstract
Mark abstract method. -
setIsKnownAmbiguous
-
withPrototypeBasedOn
Set the prototype property of a constructor. -
withClosurePrimitiveId
Sets theClosurePrimitivecorresponding to this function -
build
Constructs a new function type. -
buildAndResolve
-