code: public static <M extends TBase<?, ?>> TypeRef<M> getTypeRef(String thriftClassName, ClassLoader classLoader) {
      try {
        Class<?> tClass = classLoader == null ?
            Class.forName(thriftClassName) :
            Class.forName(thriftClassName, true, classLoader);
  
        verifyAncestry(tClass);
  
        return new TypeRef<M>(tClass){};
      } catch (ClassNotFoundException e) {
        throw new RuntimeException(e);
      }
    }
docs: returns TypeRef for a thrift class.