Class TypeVariable.Builder
- Enclosing class:
TypeVariable
Convenient builder for
TypeVariable. If no bound is added, the built
type variable will have a single bound of java.lang.Object.- Since:
- 3.1.0
-
Field Summary
FieldsFields inherited from class Type.Builder
annotations, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a bound.Adds a bound.build()Returns the built type variable.Marks the built type variable as having an implicit (not declared) bound ofObject.Methods inherited from class Type.Builder
addAnnotation, annotationsArray, self
-
Field Details
-
identifier
-
bounds
-
hasImplicitObjectBound
private boolean hasImplicitObjectBound
-
-
Constructor Details
-
Builder
Builder(String identifier)
-
-
Method Details
-
implicitObjectBound
Marks the built type variable as having an implicit (not declared) bound ofObject. It follows that all bounds added viaaddBound(Type), if any, are interface types. The erasure of the type variable is not necessarilyObjectthough; if any interface bounds are added viaaddBound(Type), the first such interface type is the erasure.- Returns:
- this builder
- Since:
- 3.3.2
-
addBound
Adds a bound. The first bound may be a class type or a type variable. If the first bound is a class type (or if the type variable has animplicitObjectBound()), the subsequent bounds must be interface types. If the first bound is a type variable, there may be no subsequent bounds.- Parameters:
bound- the bound, must not benull- Returns:
- this builder
-
addBound
Adds a bound. The first bound may be a class type or a type variable. If the first bound is a class type (or if the type variable has animplicitObjectBound()), the subsequent bounds must be interface types. If the first bound is a type variable, there may be no subsequent bounds.- Parameters:
clazz- the class whose type is added as a bound, must not benull- Returns:
- this builder
-
build
-