code: public static String getCanonicalName(UserType userType) {
          String name = getClassName(userType);
          String canonicalName;
          if (userType.isNested()) {
              Message parent = (Message) userType.getParent();
              canonicalName = getCanonicalName(parent) + '.' + name;
          } else {
              Proto proto = userType.getProto();
              String pkg = ProtoUtil.getPackage(proto);
              if (pkg.isEmpty()) {
                  canonicalName = name;
              } else {
                  canonicalName = pkg + '.' + name;
              }
          }
          return canonicalName;
      }
docs: Returns java canonical class name for a user type.