T - the generic type of the GenericType to build() after
type variables have been bound.public abstract class GenericTypeBuilder<T> extends GenericTypeCapture<T>
GenericType with custom binding for TypeVariables at runtime.
The following example illustrates the usage:
public static GenericType<List<Provider<T>>> typeOfListOfProviderOf(GenericType<T> type) { return newGenericTypeBuilder<List<Provider<T>>>() {} .with(new GenericTypeVariable<T>() {}, type) .build(); }
| Modifier and Type | Field and Description |
|---|---|
private Type |
typeArgument |
private Map<GenericTypeVariable<?>,Type> |
variable2typeMap |
| Constructor and Description |
|---|
GenericTypeBuilder()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
GenericType<T> |
build() |
<V> GenericTypeBuilder<T> |
with(GenericTypeVariable<V> variable,
Class<V> type) |
<V> GenericTypeBuilder<T> |
with(GenericTypeVariable<V> variable,
GenericType<V> type) |
<V> GenericTypeBuilder<T> |
withType(GenericTypeVariable<V> variable,
Type type) |
resolveprivate final Type typeArgument
private final Map<GenericTypeVariable<?>,Type> variable2typeMap
public <V> GenericTypeBuilder<T> with(GenericTypeVariable<V> variable, GenericType<V> type)
V - the generic type of the TypeVariable to bind.variable - the captured TypeVariable.type - the GenericType to bind to the TypeVariable.public <V> GenericTypeBuilder<T> with(GenericTypeVariable<V> variable, Class<V> type)
V - the generic type of the TypeVariable to bind.variable - the captured TypeVariable.type - the Class to bind to the TypeVariable.public <V> GenericTypeBuilder<T> withType(GenericTypeVariable<V> variable, Type type)
V - the generic type of the TypeVariable to bind.variable - the captured TypeVariable.type - the Type to bind to the TypeVariable.public GenericType<T> build()
GenericType created by this builder.Copyright © 2001–2019 mmm-Team. All rights reserved.