Skip to content

Commit cb85f4f

Browse files
author
Cody Ebberson
committed
Fixed comment styles, added note about JSON path limitations
1 parent 3c8cf31 commit cb85f4f

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ public Metadata createMetadata(Metadata metadata) {
402402

403403
/**
404404
* Creates the metadata of specified type.
405-
* @param typeName The metadata type name.
406-
* @param metadata The new metadata values.
405+
* @param typeName the metadata type name.
406+
* @param metadata the new metadata values.
407407
* @return the metadata returned from the server.
408408
*/
409409
public Metadata createMetadata(String typeName, Metadata metadata) {
@@ -425,7 +425,7 @@ public Metadata getMetadata() {
425425

426426
/**
427427
* Gets the file metadata of specified type.
428-
* @param typeName The metadata type name.
428+
* @param typeName the metadata type name.
429429
* @return the metadata returned from the server.
430430
*/
431431
public Metadata getMetadata(String typeName) {
@@ -437,7 +437,7 @@ public Metadata getMetadata(String typeName) {
437437

438438
/**
439439
* Updates the file metadata.
440-
* @param metadata The new metadata values.
440+
* @param metadata the new metadata values.
441441
* @return the metadata returned from the server.
442442
*/
443443
public Metadata updateMetadata(Metadata metadata) {
@@ -458,7 +458,7 @@ public void deleteMetadata() {
458458

459459
/**
460460
* Deletes the file metadata of specified type.
461-
* @param typeName The metadata type name.
461+
* @param typeName the metadata type name.
462462
*/
463463
public void deleteMetadata(String typeName) {
464464
URL url = METADATA_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID(), typeName);

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

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ public Metadata() {
2222

2323
/**
2424
* Creates a new metadata.
25-
* @param values The initial metadata values.
25+
* @param values the initial metadata values.
2626
*/
27-
public Metadata(JsonObject values) {
27+
Metadata(JsonObject values) {
2828
this.values = values;
2929
}
3030

3131
/**
3232
* Creates a copy of another metadata.
33-
* @param other The other metadata object to copy.
33+
* @param other the other metadata object to copy.
3434
*/
3535
public Metadata(Metadata other) {
3636
this.values = new JsonObject(other.values);
@@ -62,8 +62,8 @@ public String getParentID() {
6262

6363
/**
6464
* Adds a new metdata value.
65-
* @param path The path that designates the key. Must be prefixed with a "/".
66-
* @param value The value.
65+
* @param path the path that designates the key. Must be prefixed with a "/".
66+
* @param value the value.
6767
* @return this metadata object.
6868
*/
6969
public Metadata add(String path, String value) {
@@ -74,8 +74,8 @@ public Metadata add(String path, String value) {
7474

7575
/**
7676
* Replaces an existing metdata value.
77-
* @param path The path that designates the key. Must be prefixed with a "/".
78-
* @param value The value.
77+
* @param path the path that designates the key. Must be prefixed with a "/".
78+
* @param value the value.
7979
* @return this metadata object.
8080
*/
8181
public Metadata replace(String path, String value) {
@@ -86,7 +86,7 @@ public Metadata replace(String path, String value) {
8686

8787
/**
8888
* Removes an existing metadata value.
89-
* @param path The path that designates the key. Must be prefixed with a "/".
89+
* @param path the path that designates the key. Must be prefixed with a "/".
9090
* @return this metadata object.
9191
*/
9292
public Metadata remove(String path) {
@@ -97,8 +97,8 @@ public Metadata remove(String path) {
9797

9898
/**
9999
* Tests that a property has the expected value.
100-
* @param path The path that designates the key. Must be prefixed with a "/".
101-
* @param value The expected value.
100+
* @param path the path that designates the key. Must be prefixed with a "/".
101+
* @param value the expected value.
102102
* @return this metadata object.
103103
*/
104104
public Metadata test(String path, String value) {
@@ -108,8 +108,8 @@ public Metadata test(String path, String value) {
108108

109109
/**
110110
* Returns a value.
111-
* @param key The metadata property name.
112-
* @return The metadata property value.
111+
* @param key the metadata property name.
112+
* @return the metadata property value.
113113
*/
114114
public String get(String key) {
115115
return this.values.get(key).asString();
@@ -137,18 +137,19 @@ public String toString() {
137137

138138
/**
139139
* Converts a JSON patch path to a JSON property name.
140-
* @param path The path that designates the key. Must be prefixed with a "/".
141-
* @return The JSON property name.
140+
* Currently the metadata API only supports flat maps.
141+
* @param path the path that designates the key. Must be prefixed with a "/".
142+
* @return the JSON property name.
142143
*/
143144
private String pathToProperty(String path) {
144145
return path.substring(1);
145146
}
146147

147148
/**
148149
* Adds a patch operation.
149-
* @param op The operation type. Must be add, replace, remove, or test.
150-
* @param path The path that designates the key. Must be prefixed with a "/".
151-
* @param value The value to be set.
150+
* @param op the operation type. Must be add, replace, remove, or test.
151+
* @param path the path that designates the key. Must be prefixed with a "/".
152+
* @param value the value to be set.
152153
*/
153154
private void addOp(String op, String path, String value) {
154155
if (this.operations == null) {

0 commit comments

Comments
 (0)