Tabnine Logo
ReflectionUtils.hasIdenticalParameters
Code IndexAdd Tabnine to your IDE (free)

How to use
hasIdenticalParameters
method
in
io.swagger.v3.core.util.ReflectionUtils

Best Java code snippets using io.swagger.v3.core.util.ReflectionUtils.hasIdenticalParameters (Showing top 2 results out of 315)

origin: swagger-api/swagger-core

/**
 * Searches the method methodToFind in given class cls. If the method is found returns it, else return null.
 *
 * @param methodToFind is the method to search
 * @param cls          is the class or interface where to search
 * @return method if it is found
 */
public static Method findMethod(Method methodToFind, Class<?> cls) {
  if (cls == null) {
    return null;
  }
  String methodToSearch = methodToFind.getName();
  Class<?>[] soughtForParameterType = methodToFind.getParameterTypes();
  Type[] soughtForGenericParameterType = methodToFind.getGenericParameterTypes();
  for (Method method : cls.getMethods()) {
    if (method.getName().equals(methodToSearch) && method.getReturnType().isAssignableFrom(methodToFind.getReturnType())) {
      Class<?>[] srcParameterTypes = method.getParameterTypes();
      Type[] srcGenericParameterTypes = method.getGenericParameterTypes();
      if (soughtForParameterType.length == srcParameterTypes.length &&
          soughtForGenericParameterType.length == srcGenericParameterTypes.length) {
        if (hasIdenticalParameters(srcParameterTypes, soughtForParameterType, srcGenericParameterTypes, soughtForGenericParameterType)) {
          return method;
        }
      }
    }
  }
  return null;
}
origin: io.swagger.core.v3/swagger-core

/**
 * Searches the method methodToFind in given class cls. If the method is found returns it, else return null.
 *
 * @param methodToFind is the method to search
 * @param cls          is the class or interface where to search
 * @return method if it is found
 */
public static Method findMethod(Method methodToFind, Class<?> cls) {
  if (cls == null) {
    return null;
  }
  String methodToSearch = methodToFind.getName();
  Class<?>[] soughtForParameterType = methodToFind.getParameterTypes();
  Type[] soughtForGenericParameterType = methodToFind.getGenericParameterTypes();
  for (Method method : cls.getMethods()) {
    if (method.getName().equals(methodToSearch) && method.getReturnType().isAssignableFrom(methodToFind.getReturnType())) {
      Class<?>[] srcParameterTypes = method.getParameterTypes();
      Type[] srcGenericParameterTypes = method.getGenericParameterTypes();
      if (soughtForParameterType.length == srcParameterTypes.length &&
          soughtForGenericParameterType.length == srcGenericParameterTypes.length) {
        if (hasIdenticalParameters(srcParameterTypes, soughtForParameterType, srcGenericParameterTypes, soughtForGenericParameterType)) {
          return method;
        }
      }
    }
  }
  return null;
}
io.swagger.v3.core.utilReflectionUtilshasIdenticalParameters

Popular methods of ReflectionUtils

  • getAnnotation
    Returns an annotation by type from a method.
  • getOverriddenMethod
    Returns overridden method from superclass if it exists. If method was not found returns null.
  • getRepeatableAnnotationsArray
  • isOverriddenMethod
    Checks if the method methodToFind is the overridden method from the superclass or superinterface.
  • getDeclaredFields
    Returns the list of declared fields from the class cls and its superclasses excluding Object class.
  • getRepeatableAnnotations
    Returns a List of repeatable annotations by type from a method.
  • findMethod
    Searches the method methodToFind in given class cls. If the method is found returns it, else return
  • getParameterAnnotations
  • isConstructorCompatible
  • isInject
  • isSystemType
  • isVoid
    Checks if the type is void.
  • isSystemType,
  • isVoid,
  • loadClassByName,
  • typeFromString

Popular in Java

  • Updating database using SQL prepared statement
  • putExtra (Intent)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Path (java.nio.file)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now