Class UnionType.Builder
java.lang.Object
com.google.javascript.rhino.jstype.UnionType.Builder
- Enclosing class:
UnionType
Implements type unioning logic, since
UnionTypes only actually need to perform unioning
operations when being (re)built.
UnionType.Builders exist in two forms. One for assembing a new union and one for updating an
existing union. Only the former is exposed.
Most users of this class should prefer JSTypeRegistry.createUnionType(com.google.javascript.rhino.jstype.JSType...) instead.
-
Method Summary
Modifier and TypeMethodDescriptionaddAlternate(JSType alternate) Adds an alternate to the union type under construction.addAlternates(Collection<? extends JSType> c) addAlternates(List<? extends JSType> list) build()Returns a type, not necessarily aUnionType, that represents the union of the inputs.
-
Method Details
-
addAlternates
-
addAlternates
-
addAlternate
Adds an alternate to the union type under construction.Returns this for easy chaining.
-
build
Returns a type, not necessarily aUnionType, that represents the union of the inputs.The
UnionType.Buildercannot be used again once this method is called.
-