Class FunctionParamBuilder
java.lang.Object
com.google.javascript.rhino.jstype.FunctionParamBuilder
A builder for the list representing FunctionType Parameters
-
Constructor Summary
ConstructorsConstructorDescriptionFunctionParamBuilder(JSTypeRegistry registry) FunctionParamBuilder(JSTypeRegistry registry, int initialParameterCapacity) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddOptionalParams(JSType... types) Add optional parameters of the given type to the end of the param list.booleanaddRequiredParams(JSType... types) Add parameters of the given type to the end of the param list.booleanaddVarArgs(JSType type) Add variable arguments to the end of the parameter list.com.google.common.collect.ImmutableList<FunctionType.Parameter> build()booleanvoidCopies the parameter specification from the given parameter, but makes sure it's optional.voidCopies the existing parameter into this builder
-
Constructor Details
-
FunctionParamBuilder
-
FunctionParamBuilder
-
-
Method Details
-
addRequiredParams
Add parameters of the given type to the end of the param list.- Returns:
- False if this is called after optional params are added.
-
addOptionalParams
Add optional parameters of the given type to the end of the param list.- Parameters:
types- Types for each optional parameter. The builder will make them undefine-able.- Returns:
- False if this is called after var args are added.
-
addVarArgs
Add variable arguments to the end of the parameter list.- Returns:
- False if this is called after var args are added.
-
newParameterFrom
Copies the existing parameter into this builder -
newOptionalParameterFrom
Copies the parameter specification from the given parameter, but makes sure it's optional. -
hasVarArgs
public boolean hasVarArgs() -
build
-