This repository was archived by the owner on Mar 11, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
main/java/com/cloudant/client/api/model
test/java/com/cloudant/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Unreleased
2+ - [ NEW] Added ` com.cloudant.client.api.model.DbInfo#getDocDelCountLong() ` to return
3+ deleted document count as a ` long ` instead of a ` String ` .
4+ - [ DEPRECATED] ` com.cloudant.client.api.model.DbInfo#getDocDelCount() ` .
5+
16# 2.16.0 (2019-04-01)
27- [ NEW] Added database partition metadata fields for partitioned index count/limit.
38- [ NEW] Added replication selector support.
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ public boolean getPartitioned() {
118118 @ SerializedName ("doc_count" )
119119 private long docCount ;
120120 @ SerializedName ("doc_del_count" )
121- private String docDelCount ;
121+ private long docDelCount ;
122122 @ SerializedName ("update_seq" )
123123 private JsonElement updateSeq ;
124124 @ SerializedName ("purge_seq" )
@@ -143,7 +143,22 @@ public long getDocCount() {
143143 return docCount ;
144144 }
145145
146+ /**
147+ *
148+ * @return string form of the number of deleted documents in the database
149+ *
150+ * @see DbInfo#getDocDelCountLong
151+ */
152+ @ Deprecated
146153 public String getDocDelCount () {
154+ return Long .toString (docDelCount );
155+ }
156+
157+ /**
158+ *
159+ * @return number of deleted documents in the database
160+ */
161+ public long getDocDelCountLong () {
147162 return docDelCount ;
148163 }
149164
Original file line number Diff line number Diff line change 11/*
2- * Copyright © 2018 IBM Corp. All rights reserved.
2+ * Copyright © 2018, 2019 IBM Corp. All rights reserved.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
55 * except in compliance with the License. You may obtain a copy of the License at
1818
1919import com .cloudant .client .api .CloudantClient ;
2020import com .cloudant .client .api .Database ;
21+ import com .cloudant .client .api .model .DbInfo ;
2122import com .cloudant .tests .base .TestWithMockedServer ;
2223
2324import org .junit .jupiter .api .Test ;
@@ -136,4 +137,19 @@ public void getDbPartitionPartitionedIndexesIndexesView() {
136137 assertEquals (6 , db .info ().getPartitionedIndexes ().getIndexes ().getView ());
137138 }
138139
140+ @ Test
141+ public void getDbInfoDocDelCount () {
142+ CloudantClient c = CloudantClientHelper .newMockWebServerClientBuilder (server ).build ();
143+ Database db = c .database ("animaldb" , false );
144+
145+ MockResponse response = new MockResponse ()
146+ .setResponseCode (200 )
147+ .setBody ("{\" doc_del_count\" :7}" );
148+ server .enqueue (response );
149+
150+ DbInfo info = db .info ();
151+ assertEquals ("7" , info .getDocDelCount ());
152+ assertEquals (7l , info .getDocDelCountLong ());
153+ }
154+
139155}
You can’t perform that action at this time.
0 commit comments