public static String createTypedDocRefString(final DocRef docRef) {
        if (docRef == null) {
            return "";
        } else {
            if (docRef.getName() != null && docRef.getUuid() != null) {
                return String.join(" ",
                        docRef.getType(),
                        StringUtil.singleQuote(docRef.getName()) + " {" + docRef.getUuid() + "}");
            } else if (docRef.getName() != null) {
                return String.join(" ",
                        docRef.getType(),
                        StringUtil.singleQuote(docRef.getName()));
            } else if (docRef.getUuid() != null) {
                return String.join(" ",
                        docRef.getType(),
                        docRef.getUuid());
            } else {
                return "";
            }
        }
    }
Return true if the docRef and doc have the same UUID and type.
If either is null, returns false.
stroom-core-shared/src/main/java/stroom/docstore/shared/DocRefUtil.java