Class FunctionType.Builder
- java.lang.Object
-
- com.google.javascript.rhino.jstype.FunctionType.Builder
-
- Enclosing class:
- FunctionType
public static final class FunctionType.Builder extends java.lang.ObjectA builder class for function and arrow types.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctionTypebuild()Constructs a new function type.FunctionTypebuildAndResolve()FunctionType.BuilderforConstructor()Make this a constructor.FunctionType.BuilderforInterface()Make this an interface.FunctionType.BuildersetGoogModuleId(java.lang.String x)The ID of the goog.module in which this enum was declared.FunctionType.BuildersetIsKnownAmbiguous(boolean x)FunctionType.BuilderwithClosurePrimitiveId(ClosurePrimitive id)Sets theClosurePrimitivecorresponding to this functionFunctionType.BuilderwithConstructorTemplateKeys(java.lang.Iterable<TemplateType> constructorOnlyKeys)Specifies a subset of the template keys that only apply to the constructor, and should be removed from the instance type.FunctionType.BuilderwithInferredReturnType(JSType returnType)Sets an inferred return type.FunctionType.BuilderwithIsAbstract(boolean isAbstract)Mark abstract method.FunctionType.BuilderwithName(java.lang.String name)Set the name of the function type.FunctionType.BuilderwithParameters()Set the function to take zero parameters.FunctionType.BuilderwithParameters(java.util.List<FunctionType.Parameter> parameters)Set the parameters of the function type.FunctionType.BuilderwithPrototypeBasedOn(ObjectType setPrototypeBasedOn)Set the prototype property of a constructor.FunctionType.BuilderwithReturnType(JSType returnType)Set the return type.FunctionType.BuilderwithReturnType(JSType returnType, boolean inferred)Set the return type and whether it's inferred.FunctionType.BuilderwithSourceNode(Node sourceNode)Set the source node of the function type.FunctionType.BuilderwithTemplateKeys(com.google.common.collect.ImmutableList<TemplateType> templateKeys)Set the template name.FunctionType.BuilderwithTemplateKeys(TemplateType... templateKeys)Set the template name.FunctionType.BuilderwithTypeOfThis(JSType typeOfThis)Set the "this" type.
-
-
-
Method Detail
-
withName
public FunctionType.Builder withName(java.lang.String name)
Set the name of the function type.
-
withSourceNode
public FunctionType.Builder withSourceNode(Node sourceNode)
Set the source node of the function type.
-
setGoogModuleId
public FunctionType.Builder setGoogModuleId(java.lang.String x)
The ID of the goog.module in which this enum was declared.
-
withParameters
public FunctionType.Builder withParameters(java.util.List<FunctionType.Parameter> parameters)
Set the parameters of the function type.
-
withParameters
public FunctionType.Builder withParameters()
Set the function to take zero parameters.
-
withReturnType
public FunctionType.Builder withReturnType(JSType returnType)
Set the return type.
-
withReturnType
public FunctionType.Builder withReturnType(JSType returnType, boolean inferred)
Set the return type and whether it's inferred.
-
withInferredReturnType
public FunctionType.Builder withInferredReturnType(JSType returnType)
Sets an inferred return type.
-
withTypeOfThis
public FunctionType.Builder withTypeOfThis(JSType typeOfThis)
Set the "this" type.
-
withTemplateKeys
public FunctionType.Builder withTemplateKeys(com.google.common.collect.ImmutableList<TemplateType> templateKeys)
Set the template name.
-
withTemplateKeys
public FunctionType.Builder withTemplateKeys(TemplateType... templateKeys)
Set the template name.
-
withConstructorTemplateKeys
public FunctionType.Builder withConstructorTemplateKeys(java.lang.Iterable<TemplateType> constructorOnlyKeys)
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
public FunctionType.Builder forConstructor()
Make this a constructor.
-
forInterface
public FunctionType.Builder forInterface()
Make this an interface.
-
withIsAbstract
public FunctionType.Builder withIsAbstract(boolean isAbstract)
Mark abstract method.
-
setIsKnownAmbiguous
public FunctionType.Builder setIsKnownAmbiguous(boolean x)
-
withPrototypeBasedOn
public FunctionType.Builder withPrototypeBasedOn(ObjectType setPrototypeBasedOn)
Set the prototype property of a constructor.
-
withClosurePrimitiveId
public FunctionType.Builder withClosurePrimitiveId(ClosurePrimitive id)
Sets theClosurePrimitivecorresponding to this function
-
build
public FunctionType build()
Constructs a new function type.
-
buildAndResolve
public FunctionType buildAndResolve()
-
-