Tabnine Logo
Reflects.compareParameterTypes
Code IndexAdd Tabnine to your IDE (free)

How to use
compareParameterTypes
method
in
org.jupiter.common.util.Reflects

Best Java code snippets using org.jupiter.common.util.Reflects.compareParameterTypes (Showing top 8 results out of 315)

origin: fengjiachun/Jupiter

/**
 * Find an array of parameter {@link Type}s that matches the given compatible parameters.
 */
public static Class<?>[] findMatchingParameterTypes(List<Class<?>[]> parameterTypesList, Object[] args) {
  if (parameterTypesList.size() == 1) {
    return parameterTypesList.get(0);
  }
  // 获取参数类型
  Class<?>[] parameterTypes;
  if (args == null || args.length == 0) {
    parameterTypes = new Class[0];
  } else {
    parameterTypes = new Class[args.length];
    for (int i = 0; i < args.length; i++) {
      if (args[i] != null) {
        parameterTypes[i] = args[i].getClass();
      }
    }
  }
  Class<?>[] bestMatch = null;
  for (Class<?>[] pTypes : parameterTypesList) {
    if (isAssignable(parameterTypes, pTypes, true)) {
      if (bestMatch == null
          || compareParameterTypes(pTypes, bestMatch, parameterTypes) < 0) {
        bestMatch = pTypes;
      }
    }
  }
  return bestMatch;
}
origin: fengjiachun/Jupiter

/**
 * Find an array of parameter {@link Type}s that matches the given compatible parameters.
 */
public static Class<?>[] findMatchingParameterTypes(List<Class<?>[]> parameterTypesList, Object[] args) {
  if (parameterTypesList.size() == 1) {
    return parameterTypesList.get(0);
  }
  // 获取参数类型
  Class<?>[] parameterTypes;
  if (args == null || args.length == 0) {
    parameterTypes = new Class[0];
  } else {
    parameterTypes = new Class[args.length];
    for (int i = 0; i < args.length; i++) {
      if (args[i] != null) {
        parameterTypes[i] = args[i].getClass();
      }
    }
  }
  Class<?>[] bestMatch = null;
  for (Class<?>[] pTypes : parameterTypesList) {
    if (isAssignable(parameterTypes, pTypes, true)) {
      if (bestMatch == null
          || compareParameterTypes(pTypes, bestMatch, parameterTypes) < 0) {
        bestMatch = pTypes;
      }
    }
  }
  return bestMatch;
}
origin: fengjiachun/Jupiter

if (isAssignable(parameterTypes, pTypes, true)) {
  if (bestMatch == null
      || compareParameterTypes(pTypes, bestMatch.getFirst(), parameterTypes) < 0) {
    bestMatch = pair;
origin: fengjiachun/Jupiter

if (isAssignable(parameterTypes, pTypes, true)) {
  if (bestMatch == null
      || compareParameterTypes(pTypes, bestMatch.getFirst(), parameterTypes) < 0) {
    bestMatch = pair;
origin: org.jupiter-rpc/jupiter-all

/**
 * Find an array of parameter {@link Type}s that matches the given compatible parameters.
 */
public static Class<?>[] findMatchingParameterTypes(List<Class<?>[]> parameterTypesList, Object[] args) {
  if (parameterTypesList.size() == 1) {
    return parameterTypesList.get(0);
  }
  // 获取参数类型
  Class<?>[] parameterTypes;
  if (args == null || args.length == 0) {
    parameterTypes = new Class[0];
  } else {
    parameterTypes = new Class[args.length];
    for (int i = 0; i < args.length; i++) {
      if (args[i] != null) {
        parameterTypes[i] = args[i].getClass();
      }
    }
  }
  Class<?>[] bestMatch = null;
  for (Class<?>[] pTypes : parameterTypesList) {
    if (isAssignable(parameterTypes, pTypes, true)) {
      if (bestMatch == null
          || compareParameterTypes(pTypes, bestMatch, parameterTypes) < 0) {
        bestMatch = pTypes;
      }
    }
  }
  return bestMatch;
}
origin: org.jupiter-rpc/jupiter-common

/**
 * Find an array of parameter {@link Type}s that matches the given compatible parameters.
 */
public static Class<?>[] findMatchingParameterTypes(List<Class<?>[]> parameterTypesList, Object[] args) {
  if (parameterTypesList.size() == 1) {
    return parameterTypesList.get(0);
  }
  // 获取参数类型
  Class<?>[] parameterTypes;
  if (args == null || args.length == 0) {
    parameterTypes = new Class[0];
  } else {
    parameterTypes = new Class[args.length];
    for (int i = 0; i < args.length; i++) {
      if (args[i] != null) {
        parameterTypes[i] = args[i].getClass();
      }
    }
  }
  Class<?>[] bestMatch = null;
  for (Class<?>[] pTypes : parameterTypesList) {
    if (isAssignable(parameterTypes, pTypes, true)) {
      if (bestMatch == null
          || compareParameterTypes(pTypes, bestMatch, parameterTypes) < 0) {
        bestMatch = pTypes;
      }
    }
  }
  return bestMatch;
}
origin: org.jupiter-rpc/jupiter-common

if (isAssignable(parameterTypes, pTypes, true)) {
  if (bestMatch == null
      || compareParameterTypes(pTypes, bestMatch.getFirst(), parameterTypes) < 0) {
    bestMatch = pair;
origin: org.jupiter-rpc/jupiter-all

if (isAssignable(parameterTypes, pTypes, true)) {
  if (bestMatch == null
      || compareParameterTypes(pTypes, bestMatch.getFirst(), parameterTypes) < 0) {
    bestMatch = pair;
org.jupiter.common.utilReflectscompareParameterTypes

Javadoc

Compares the relative fitness of two sets of parameter types in terms of matching a third set of runtime parameter types, such that a list ordered by the results of the comparison would return the best match first (least).

Popular methods of Reflects

  • simpleClassName
    The shortcut to #simpleClassName(Class).
  • fastInvoke
    Invokes the underlying method, fast invoke using ASM.
  • findMatchingParameterTypes
    Find an array of parameter Types that matches the given compatible parameters.
  • findMatchingParameterTypesExt
    Find an array of parameter Types that matches the given compatible parameters.
  • getField
    Returns a Field object that reflects the specified declared field of the Class or interface represen
  • getObjectTransformationCost
    Gets the number of steps required needed to turn the source class into the destination class. This r
  • getPrimitivePromotionCost
    Gets the number of steps required to promote a primitive number to another type.
  • getTotalTransformationCost
    Returns the sum of the object transformation cost for each class in the source argument list.
  • getTypeDefaultValue
  • isAssignable
    Checks if an array of Classes can be assigned to another array of Classes.
  • primitiveToWrapper
    Converts the specified primitive Class object to its corresponding wrapper Class object.
  • setAccessible
    Set the accessible flag for this object to the indicated boolean value. A value of true indicates th
  • primitiveToWrapper,
  • setAccessible,
  • wrapperToPrimitive,
  • getStaticValue

Popular in Java

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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