- private Entity createEntity(YangInstanceIdentifier entityPath) {
- String entityType = null;
- YangInstanceIdentifier entityId = null;
- for(PathArgument pathArg: entityPath.getPathArguments()) {
- if(pathArg instanceof NodeIdentifierWithPredicates) {
- NodeIdentifierWithPredicates nodeKey = (NodeIdentifierWithPredicates) pathArg;
- Entry<QName, Object> key = nodeKey.getKeyValues().entrySet().iterator().next();
- if(ENTITY_TYPE_QNAME.equals(key.getKey())) {
- entityType = key.getValue().toString();
- } else if(ENTITY_ID_QNAME.equals(key.getKey())) {
- entityId = (YangInstanceIdentifier) key.getValue();
- }
- }
- }
-
- return new Entity(entityType, entityId);
+ private String extractOwner(LeafNode<?> ownerLeaf) {
+ Object value = ownerLeaf.getValue();
+ return value != null ? value.toString() : null;