driver-core/src/main/com/mongodb/WriteConcern.java
public BsonDocument asDocument() {
        BsonDocument document = new BsonDocument();

        addW(document);

        addWTimeout(document);
        addFSync(document);
        addJ(document);

        return document;
    }
public BsonDocument asDocument() {
        BsonDocument document = new BsonDocument();

        addW(document);

        addWTimeout(document);
        addFSync(document);
        addJ(document);

        return document;
    }
Gets this write concern as a document.

@return The write concern as a BsonDocument, even if {@code w &lt;= 0}