Skip to content

Commit 8861fe3

Browse files
committed
Change addPendingChange to take a JsonValue
This makes it possible to update nested objects within an Info object. For example, when updating the shared link JSON object within a file info JSON object.
1 parent 5a12902 commit 8861fe3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/com/box/sdk/BoxItem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public String getName() {
5555

5656
public void setName(String name) {
5757
this.name = name;
58-
this.addPendingChange("name", name);
58+
this.addPendingChange("name", JsonValue.valueOf(name));
5959
}
6060

6161
public Date getCreatedAt() {
@@ -72,7 +72,7 @@ public String getDescription() {
7272

7373
public void setDescription(String description) {
7474
this.description = description;
75-
this.addPendingChange("description", description);
75+
this.addPendingChange("description", JsonValue.valueOf(description));
7676
}
7777

7878
public long getSize() {

src/main/java/com/box/sdk/BoxResource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.List;
44

55
import com.eclipsesource.json.JsonObject;
6+
import com.eclipsesource.json.JsonValue;
67

78
/**
89
* The abstract base class for all resource types (files, folders, comments, collaborations, etc.) used by the API.
@@ -140,7 +141,7 @@ public String getPendingChanges() {
140141
* @param key the name of the field.
141142
* @param value the new value of the field.
142143
*/
143-
protected void addPendingChange(String key, String value) {
144+
protected void addPendingChange(String key, JsonValue value) {
144145
this.pendingChanges.set(key, value);
145146
}
146147

0 commit comments

Comments
 (0)