public List<ModelType<?>> getTypeVariables() { if (isParameterized()) { TypeWrapper[] typeArguments = ((ParameterizedTypeWrapper) wrapper).getActualTypeArguments(); ImmutableList.Builder<ModelType<?>> builder = ImmutableList.builder(); for (TypeWrapper typeArgument : typeArguments) { builder.add(Simple.typed(typeArgument)); } return builder.build(); } else { return Collections.emptyList(); } }
@Nullable public ModelType<?> getLowerBound() { WildcardWrapper wildcardType = getWildcardType(); if (wildcardType == null) { return null; } else { TypeWrapper lowerBound = wildcardType.getLowerBound(); if (lowerBound == null) { return null; } return Simple.typed(lowerBound); } }
@Nullable public ModelType<?> getUpperBound() { WildcardWrapper wildcardType = getWildcardType(); if (wildcardType == null) { return null; } else { ModelType<?> upperBound = Simple.typed(wildcardType.getUpperBound()); if (upperBound.equals(UNTYPED)) { return null; } return upperBound; } }
public static ModelType<?> of(Type type) { return Simple.typed(type); }
public ModelType<T> build() { return Simple.typed((TypeWrapper) wrapper); }