Class ReflectUtils

java.lang.Object
org.apache.beam.sdk.schemas.utils.ReflectUtils

@Internal public class ReflectUtils extends Object
A set of reflection helper methods.
  • Constructor Details

    • ReflectUtils

      public ReflectUtils()
  • Method Details

    • getMethods

      public static List<Method> getMethods(Class<?> clazz)
      Returns the list of non private/protected, non-static methods in the class, caching the results.
    • getMethodsMap

      public static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.Multimap<String,Method> getMethodsMap(Class<?> clazz)
    • getAnnotatedConstructor

      public static @Nullable Constructor getAnnotatedConstructor(Class<?> clazz)
    • getAnnotatedCreateMethod

      public static @Nullable Method getAnnotatedCreateMethod(Class<?> clazz)
    • getFields

      public static List<Field> getFields(Class<?> clazz)
    • isGetter

      public static boolean isGetter(Method method)
    • isSetter

      public static boolean isSetter(Method method)
    • stripPrefix

      public static String stripPrefix(String methodName, String prefix)
    • stripGetterPrefix

      public static String stripGetterPrefix(String method)
    • stripSetterPrefix

      public static String stripSetterPrefix(String method)
    • getIterableComponentType

      public static @Nullable TypeDescriptor getIterableComponentType(TypeDescriptor valueType)
      For an array T[] or a subclass of Iterable, return a TypeDescriptor describing T.
    • getMapType

      public static TypeDescriptor getMapType(TypeDescriptor valueType, int index)
    • boxIfPrimitive

      public static TypeDescriptor boxIfPrimitive(TypeDescriptor typeDescriptor)