code: public static int getAbsoluteLevel(@NotNull String path) {
      if (StringUtils.isEmpty(path) || StringUtils.equals(path, "/")) {
        return -1;
      }
      return StringUtils.countMatches(path, "/") - 1;
    }
docs: Gets level from parent use same logic (but reverse) as {@link com.day.text.Text#getAbsoluteParent(String, int)}.
  @param path Path
  @return level &gt;= 0 if path is value, -1 if path is invalid