Skip to content

Commit 3f62c04

Browse files
author
Grace Calianese
committed
don't need complicated method implementation
1 parent 116d869 commit 3f62c04

1 file changed

Lines changed: 1 addition & 20 deletions

File tree

  • model/src/main/java/com/basistech/rosette/apimodel/recordsimilarity/records

model/src/main/java/com/basistech/rosette/apimodel/recordsimilarity/records/UnknownField.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
package com.basistech.rosette.apimodel.recordsimilarity.records;
1818

19-
import java.util.LinkedHashMap;
20-
import java.util.Map;
21-
2219
import com.fasterxml.jackson.annotation.JsonCreator;
2320
import com.fasterxml.jackson.annotation.JsonFormat;
2421
import com.fasterxml.jackson.annotation.JsonValue;
@@ -49,23 +46,7 @@ public String toString() {
4946

5047
@JsonValue
5148
public Object getData() {
52-
if (data == null) {
53-
return "";
54-
} else {
55-
if (data.isObject()) {
56-
Map<String, JsonNode> map = new LinkedHashMap<>();
57-
data.fields().forEachRemaining(fieldEntry -> map.put(fieldEntry.getKey(), fieldEntry.getValue()));
58-
try {
59-
ObjectMapper mapper = new ObjectMapper();
60-
String jsonString = mapper.writeValueAsString(map);
61-
return mapper.readTree(jsonString);
62-
} catch (JsonProcessingException e) {
63-
return this.data;
64-
}
65-
}
66-
// if given input is not an Object node, it's a String so return it
67-
return this.data;
68-
}
49+
return this.data;
6950
}
7051

7152
//compare the content of the String form of the UnknownFields' data

0 commit comments

Comments
 (0)