Class KeyValueUtils
java.lang.Object
com.priint.pubserver.plugin.entitydata.utils.KeyValueUtils
Helper methods for intersecting or joining lists of KeyValue.
- Since:
- 4.1.0
-
Constructor Details
-
KeyValueUtils
public KeyValueUtils()
-
-
Method Details
-
getIntersectionOfKeyValueList
public List<KeyValue> getIntersectionOfKeyValueList(List<List<KeyValue>> listOfKeyValuesList, List<String> compareCriteria) throws PubServerException The parameter list of KeyValue lists is passed. Common Key Value pairs are summarized in a results list. A parameter can be used to control which data items are checked for equality. KV's only come back when the key (or keylabel) was found in every listOflist.
So we have to look only for keys (or keylabels) of the first KV-list.- Parameters:
listOfKeyValuesList- The list of key value lists to analyze for equality.compareCriteria- List of elements those who will be checked for equality.- Returns:
- intersection of KV's matching the compareCriteria.
- Throws:
PubServerException- Since:
- 4.1.0
-
getUnionOfKeyValueList
public List<KeyValue> getUnionOfKeyValueList(List<List<KeyValue>> listOfKeyValuesList, List<String> compareCriteria) throws PubServerException The parameter list of KeyValue lists is passed. There is formed a union. It can be passed as parameters, according to which criteria the union be formed. KV's come back when the key (or keylabel) was found in one of the listOfLists.
By forming the union will be no "duplicates".- Parameters:
listOfKeyValuesList- The list of key value lists to analyze for union.compareCriteria- List of elements those who will be checked for unionable.- Returns:
- union of KV's matching the compareCriteria.
- Throws:
PubServerException- Since:
- 4.1.0
-