private static Optional<ResolvedType> getGenericParameterByName(String typeName, ResolvedTypeParametrizable typeParametrizable) { Optional<ResolvedTypeParameterDeclaration> tp = typeParametrizable.findTypeParameter(typeName); return tp.map(ResolvedTypeVariable::new); }
private static Optional<ResolvedType> getGenericParameterByName(String typeName, ResolvedTypeParametrizable typeParametrizable) { Optional<ResolvedTypeParameterDeclaration> tp = typeParametrizable.findTypeParameter(typeName); return tp.map(ResolvedTypeVariable::new); }
private static ResolvedType getGenericParameterByName(String typeName, ResolvedTypeParametrizable typeParametrizable, TypeSolver typeSolver) { Optional<ResolvedType> type = typeParametrizable.findTypeParameter(typeName).map(ResolvedTypeVariable::new); return type.orElseGet(() -> new ReferenceTypeImpl( typeSolver.solveType(removeTypeArguments(internalNameToCanonicalName(typeName))), typeSolver)); }
} else if (signatureType instanceof SignatureAttribute.TypeVariable) { SignatureAttribute.TypeVariable typeVariableSignature = (SignatureAttribute.TypeVariable)signatureType; Optional<ResolvedTypeParameterDeclaration> typeParameterDeclarationOpt = typeParametrizable.findTypeParameter(typeVariableSignature.getName()); if (!typeParameterDeclarationOpt.isPresent()) { throw new UnsolvedSymbolException("Unable to solve TypeVariable " + typeVariableSignature);
} else if (signatureType instanceof SignatureAttribute.TypeVariable) { SignatureAttribute.TypeVariable typeVariableSignature = (SignatureAttribute.TypeVariable) signatureType; Optional<ResolvedTypeParameterDeclaration> typeParameterDeclarationOpt = typeParametrizable.findTypeParameter(typeVariableSignature.getName()); if (!typeParameterDeclarationOpt.isPresent()) { throw new UnsolvedSymbolException("Unable to solve TypeVariable " + typeVariableSignature);
} else if (signatureType instanceof SignatureAttribute.TypeVariable) { SignatureAttribute.TypeVariable typeVariableSignature = (SignatureAttribute.TypeVariable)signatureType; Optional<ResolvedTypeParameterDeclaration> typeParameterDeclarationOpt = typeParametrizable.findTypeParameter(typeVariableSignature.getName()); if (!typeParameterDeclarationOpt.isPresent()) { throw new UnsolvedSymbolException("Unable to solve TypeVariable " + typeVariableSignature);