code: private static boolean isLink(Object data) {
      try {
        final Map<String, Object> map = (Map<String, Object>) data;
        final Map<String, Object> sys = (Map<String, Object>) map.get("sys");
        final String type = (String) sys.get("type");
        final String linkType = (String) sys.get("linkType");
        final String id = (String) sys.get("id");
  
        if ("Link".equals(type)
            && ("Entry".equals(linkType) || "Asset".equals(linkType)
            && id != null)) {
          return true;
        }
      } catch (ClassCastException cast) {
        return false;
      }
      return false;
    }
docs: Is the give object a link of any kind?