INNER CODE UNIT · Java

parameterizedRequestType

scalecube/scalecube-services · services-api/src/main/java/io/scalecube/services/Reflect.java:158

  public static Type parameterizedRequestType(Method method) {
    if (method != null && method.getGenericParameterTypes().length > 0) {
      Type type = method.getGenericParameterTypes()[0];
      if (type instanceof ParameterizedType pt) {
        return isAsyncContainer(type) ? pt.getActualTypeArguments()[0] : pt;
      }
    }

    return Object.class;
  }

  private static boolean isAsyncContainer(Type type) {
    Class<?> raw = toClass(type);

    if (raw == null) {
      return false;
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…