Creates a {@link JsonDocument} which the document id and JSON content.

@param id the per-bucket unique document id.
@param content the content of the document.
@return a {@link JsonDocument}.
182441
public static JsonDocument create(String id, JsonObject content) {
        return new JsonDocument(id, 0, content, 0, null);
    }
434992
@InterfaceAudience.Private
    public static boolean isValidDocumentId(String id) {
        // http://wiki.apache.org/couchdb/HTTP_Document_API#Documents
        if (id == null || id.length() == 0)
            return false;
        if (id.charAt(0) == '_')
            return (id.startsWith("_design/"));
        return true;
        // "_local/*" is not a valid document ID.
        // Local docs have their own API and shouldn't get here.
    }
1219351
public Document createRaw(@NonNull String id, @NonNull String content) {
      return createRaw(id, content, defaultLanguage, Collections.emptyMap());
   }
726729
public Document buildPage(Map<String, Object> content) {
    Document doc = documentBuilder.newDocument();
    Element jcrRoot = createJcrRoot(doc, NT_PAGE);
    Element jcrContent = createJcrContent(doc, jcrRoot, NT_PAGE_CONTENT);

    exportPayload(doc, jcrContent, content);

    return doc;
  }
552373
public static Identity createExtendedIdentity(Document doc) throws MarshalException {
		String idName = DomHelpers.prepareExtendedIdentifier(doc);
		return createIdentity(IdentityType.other, idName, null,
				IfmapStrings.OTHER_TYPE_EXTENDED_IDENTIFIER);
	}
285946
public static UniversalIdStrQueueMessage newInstance(String content) {
        UniversalIdStrQueueMessage msg = newInstance();
        msg.setContent(content);
        return msg;
    }
1195175
protected Document createDocument(String spaceId, String key) {
        Document doc = new Document();
        doc.add(new StringField(FIELD_SPACE_ID, spaceId.trim(), Store.YES));
        doc.add(new StringField(FIELD_KEY, key.trim(), Store.YES));
        doc.add(new StringField(FIELD_ID, spaceId.trim() + ":" + key.trim(), Store.NO));
        return doc;
    }
1196447
public static BinaryDocument create(String id, ByteBuf content) {
        return new BinaryDocument(id, 0, content, 0, null);
    }
441500
protected Document byId(final K key) {
        if (key != null) {
            return new Document(ID, key.toString());
        } else {
            throw new NullPointerException("Key must not be null");
        }
    }
271565
@Override
    public DocumentTranslationRequestData createDocumentTranslationRequest(
            NewDocumentTranslationRequestData newTranslationRequestData)
            throws ServiceException {
        if (newTranslationRequestData == null) {
            throw new IllegalArgumentException("Non-empty newTranslationRequestData must be specified.");
        }

        RestInputDocumentTranslationRequestData newRestTRData = new RestInputDocumentTranslationRequestData(newTranslationRequestData);
        Gson gson = createGson(RestInputDocumentTranslationRequestData.class.getName());
        String jsonBody = gson.toJson(newRestTRData, RestInputDocumentTranslationRequestData.class);
        DocumentTranslationRequestResponse resp = invokeApiJson(
                "POST",
                escapePathSegment(account.getInstanceId()) + "/v2/doc-trs/new",
                jsonBody,
                DocumentTranslationRequestResponse.class);

        if (resp.getStatus() == Status.ERROR) {
            throw new ServiceException(resp.getMessage());
        }

        return new DocumentTranslationRequestDataImpl(resp.id, resp.translationRequest);
    
    }
592567
public long setDocumentContent(long taskId, Content content) {
        Task task = persistenceContext.findTask(taskId);
        persistenceContext.persistContent(content);
        ((InternalTaskData) task.getTaskData()).setDocumentContentId(content.getId());
        return content.getId();
    }
996756
public OvhDocument document_documentId_GET(String documentId) throws IOException {
		String qPath = "/store/document/{documentId}";
		StringBuilder sb = path(qPath, documentId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhDocument.class);
	}
390872
public static Document create(@NonNull String id, @NonNull String text) {
      return DocumentFactory.getInstance().create(id, text);
   }
1297707
public PrintWriter getContentWriter(String id) {
        try {
            OutputStream out = new FileOutputStream(getLogFile(id));
            Writer writer = new OutputStreamWriter(out, "UTF-8");
            return new PrintWriter(writer, true);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
382522
@SafeVarargs
    public static JsonDocument toJsonDocument(final Object... a) {
        return a.length == 1 ? toJsonDocument(a[0], toJsonObject(a[0])) : toJsonDocument(a, toJsonObject(a));
    }
585441
@InterfaceStability.Committed
    public AsyncMutateInBuilder upsert(JsonObject content) {
        this.mutationSpecs.add(new MutationSpec(Mutation.UPSERTDOC, "", content));
        return this;
    }
839050
public Document buildContent(Map<String, Object> content) {
    Document doc = documentBuilder.newDocument();

    String primaryType = StringUtils.defaultString((String)content.get(PN_PRIMARY_TYPE), NT_UNSTRUCTURED);
    Element jcrRoot = createJcrRoot(doc, primaryType);

    exportPayload(doc, jcrRoot, content);

    return doc;
  }