+
+ /**
+ * Build Route Key for supporting mp
+ * Key is composed by 2 elements (route-key + path Id)
+ *
+ * @param routeQname route Qname
+ * @param routeKeyQname route key Qname
+ * @param pathIdQname path Id Qname
+ * @param routeKeyValue route key value
+ * @param maybePathIdLeaf path id container, it might me supported or not, in that case default 0 value will be assigned
+ * @return Route Key Nid
+ */
+ public static NodeIdentifierWithPredicates createNidKey(final QName routeQname, final QName routeKeyQname, final QName pathIdQname,
+ final Object routeKeyValue, final Optional<DataContainerChild<? extends PathArgument, ?>> maybePathIdLeaf) {
+ // FIXME: a cache here would mean we instantiate the same identifier for each route making comparison quicker.
+ final Object pathId = maybePathIdLeaf.isPresent() ? (maybePathIdLeaf.get()).getValue() : NON_PATH_ID;
+ return createNodeIdentifierWithPredicates(routeQname, pathIdQname, pathId, routeKeyQname, routeKeyValue);
+ }