MCPcopy Create free account
hub / github.com/chain/Core / extract

Method extract

analytics/src/main/java/com/chain/analytics/JsonPath.java:25–41  ·  view source on GitHub ↗
(final Transaction tx)

Source from the content-addressed store, hash-verified

23 }
24
25 public Object extract(final Transaction tx) {
26 if (mPath.isEmpty()) {
27 return tx;
28 }
29
30 // The first component in the path is a top-level transaction
31 // field. All the subsequent fields index into unstructured json.
32 String field = mPath.get(0);
33
34 Map<String, Object> deserializedJson = null;
35 switch (field.toLowerCase()) {
36 case "reference_data":
37 deserializedJson = tx.referenceData;
38 break;
39 }
40 return extract(deserializedJson, mPath.subList(1, mPath.size()));
41 }
42
43 public Object extract(final Transaction.Input input) {
44 if (mPath.isEmpty()) {

Callers 2

testExtractMethod · 0.95
processBatchMethod · 0.80

Calls 2

sizeMethod · 0.80
getMethod · 0.45

Tested by 1

testExtractMethod · 0.76