public interface TypeBuilder
A type builder is used to build parameterized types.
A typical usage is:
Type listOfStringType = Types.type(List.class).type(String.class).and().build();
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies an array type as the next argument of the parameterized type.build()
Builds the type.Specifies the owner type of the parameterized type.Specifies the owner type of the parameterized type.Specifies a type as the next argument of the parameterized type.Specifies a type as the next argument of the parameterized type.variableType
(String name) Specifies a variable type as the next argument of the parameterized type.Specifies a wildcard type as the next argument of the parameterized type.
-
Method Details
-
type
Specifies a type as the next argument of the parameterized type.
- Parameters:
rawType
- an erased type- Returns:
- a type argument builder with this builder as parent
-
type
Specifies a type as the next argument of the parameterized type.
- Parameters:
type
- a type- Returns:
- this builder
-
variableType
Specifies a variable type as the next argument of the parameterized type.
- Parameters:
name
- The name of the variable- Returns:
- a type variable builder with this builder as parent
-
wildcardType
WildcardTypeArgumentBuilder<TypeBuilder> wildcardType()Specifies a wildcard type as the next argument of the parameterized type.
- Returns:
- a wildcard type argument builder with this builder as parent
-
arrayType
ArrayTypeArgumentBuilder<TypeBuilder> arrayType()Specifies an array type as the next argument of the parameterized type.
- Returns:
- an array type argument builder with this builder as parent
-
ownerType
Specifies the owner type of the parameterized type.
- Parameters:
rawType
- the erased type of the owner- Returns:
- a type argument builder with this builder as parent
-
ownerType
Specifies the owner type of the parameterized type.
- Parameters:
type
- the type of the owner- Returns:
- this builder
-
build
Type build()Builds the type.
- Returns:
- a parameterized type
- Throws:
IllegalStateException
- if the builder is not in a proper state to build a type
-