Ejemplo n.º 1
0
 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();
   }
 }
Ejemplo n.º 2
0
 @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);
   }
 }
Ejemplo n.º 3
0
 @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;
   }
 }
Ejemplo n.º 4
0
 public static ModelType<?> of(Type type) {
   return Simple.typed(type);
 }
Ejemplo n.º 5
0
 public ModelType<T> build() {
   return Simple.typed((TypeWrapper) wrapper);
 }