Esempio n. 1
0
 @NotNull
 public static PsiTypeParameter[] getTypeParameters(@NotNull PsiTypeParameterListOwner owner) {
   final PsiTypeParameterList typeParameterList = owner.getTypeParameterList();
   if (typeParameterList != null) {
     return typeParameterList.getTypeParameters();
   }
   return PsiTypeParameter.EMPTY_ARRAY;
 }
Esempio n. 2
0
 public static int getTypeParameterIndex(
     @NotNull PsiTypeParameter typeParameter, @NotNull PsiTypeParameterList typeParameterList) {
   PsiTypeParameter[] typeParameters = typeParameterList.getTypeParameters();
   for (int i = 0; i < typeParameters.length; i++) {
     if (typeParameter.equals(typeParameters[i])) return i;
   }
   LOG.assertTrue(false);
   return -1;
 }
Esempio n. 3
0
 public static boolean hasTypeParameters(@NotNull PsiTypeParameterListOwner owner) {
   final PsiTypeParameterList typeParameterList = owner.getTypeParameterList();
   return typeParameterList != null && typeParameterList.getTypeParameters().length != 0;
 }