Commit 2a0fed09 authored by Aleksandra Tsys's avatar Aleksandra Tsys
Browse files

Mark lines for adding the code. Wrote PayloadToMap function. Writing isAddResult function.

parent d4ddb7f8
This diff is collapsed.
private boolean isAddResult(LookupResult result, Map<String, String[]> payloadMap) {
for (String key : payloadMap.keySet()) {
if (result.key not in payloadMap.get(key)) {
return false;
}
}
return true;
}
private Map<String, String[]> PayloadToMap(BytesRef payload) {
String spayload = payload.toString();
Map<String, String[]> myMap = new HashMap<String, ArrayList<String>>();
String[] pairs = spayload.split(";");
for (int i = 0; i < pairs.length; i++) {
String[] keyValues = pairs[i].split(":");
String[] values = keyValue[1].split(",");
myMap.put(keyValues[0], values);
}
return MyMap;
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment