@Nonnull
  public ApiFuture<DocumentSnapshot> get(@Nonnull DocumentReference documentRef) {
    Preconditions.checkState(isEmpty(), READ_BEFORE_WRITE_ERROR_MSG);

    return ApiFutures.transform(
        firestore.getAll(new DocumentReference[] {documentRef}, /*fieldMask=*/ null, transactionId),
        new ApiFunction<List<DocumentSnapshot>, DocumentSnapshot>() {
          @Override
          public DocumentSnapshot apply(List<DocumentSnapshot> snapshots) {
            return snapshots.isEmpty() ? null : snapshots.get(0);
          }
        });
  }
@ Nonnull public ApiFuture < DocumentSnapshot > get ( @ Nonnull DocumentReference documentRef ) { Preconditions . checkState ( isEmpty ( ) , READ_BEFORE_WRITE_ERROR_MSG ) ; return ApiFutures . transform ( firestore . getAll ( new DocumentReference [ ] { documentRef } , null , transactionId ) , new ApiFunction < List < DocumentSnapshot > , DocumentSnapshot > ( ) { @ Override public DocumentSnapshot apply ( List < DocumentSnapshot > snapshots ) { return snapshots . isEmpty ( ) ? null : snapshots . get ( 0 ) ; } } ) ; }
Reads the document referred to by the provided DocumentReference. Holds a pessimistic lock on
the returned document.

@return The contents of the Document at this DocumentReference.