code: @SuppressWarnings("null")
    public boolean accepts(@NotNull LinkRequest linkRequest) {
      ValueMap props = linkRequest.getResourceProperties();
      // check for matching link type ID in link resource
      String linkTypeId = props.get(LinkNameConstants.PN_LINK_TYPE, String.class);
      if (StringUtils.isNotEmpty(linkTypeId)) {
        return StringUtils.equals(linkTypeId, getId());
      }
      // if not link type is set at all check if link ref attribute contains a valid link
      else {
        String linkRef = props.get(getPrimaryLinkRefProperty(), String.class);
        return accepts(linkRef);
      }
    }
docs: Checks whether a link reference can be handled by this link type
  @param linkRequest Link reference
  @return true if this link type can handle the given link reference