Exemple #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();
   }
 }
Exemple #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);
   }
 }
Exemple #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;
   }
 }
Exemple #4
0
 public static ModelType<?> of(Type type) {
   return Simple.typed(type);
 }
Exemple #5
0
 public ModelType<T> build() {
   return Simple.typed((TypeWrapper) wrapper);
 }