1 package org.onap.sdc.dcae.catalog.commons;
3 import java.util.Iterator;
5 import com.google.common.base.Predicate;
6 import com.google.common.collect.Iterators;
8 import org.json.JSONObject;
15 public static String literalMap(JSONObject theProps,
18 String theAssignmentOp,
20 Predicate theFieldFilter) {
21 if(theProps.length() == 0)
23 StringBuilder sb = new StringBuilder("");
24 for (Iterator i = Iterators.filter(theProps.keys(),
27 String propName = (String)i.next();
29 if (theNameAlias != null) {
30 sb.append(theNameAlias)
36 .append(theAssignmentOp)
38 .append(theValueAlias)
43 .append(theRelationOp);
45 return sb.substring(0, sb.length() - theRelationOp.length());
48 public static String literalMap(JSONObject theProps,
50 return literalMap(theProps, null, theAlias, ":", ",", f -> true);