Code example for Method

Methods: getDeclaringClass, getReturnType

0
      add(method); 
    } 
  } 
 
  public boolean add(Method method) { 
    MethodSignature key = new MethodSignature(method); 
    Method existing = map.get(key); 
    if (existing != null) { 
      if (existing.getReturnType().isAssignableFrom(method.getReturnType())) { 
        if (existing.getDeclaringClass().isAssignableFrom(method.getDeclaringClass())) { 
          map.put(key, method); 
          return true; 
        } 
      } 
    } else { 
      map.put(key, method); 
      return true; 
    } 
    return false; 
  }