BUG-994: introduce SchemaPath.getLastComponent() 08/8408/4
authorRobert Varga <rovarga@cisco.com>
Thu, 26 Jun 2014 18:59:02 +0000 (20:59 +0200)
committerRobert Varga <rovarga@cisco.com>
Tue, 1 Jul 2014 12:36:15 +0000 (14:36 +0200)
As it turns out we access the last component quite frequently. Let's
just expose it to the users, so they do not have to go through hoops to
find it.

Change-Id: I434f729f08196ad768e9326ffdc1cf9409ea8f07
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaPath.java

index e1778e47cd1d67839d853a2767e8d1d8c3070466..7bae5f0f57daf182827fbcedbc5d045689ef62f7 100644 (file)
@@ -276,6 +276,15 @@ public abstract class SchemaPath implements Immutable {
         return parent;
     }
 
+    /**
+     * Get the last component of this path.
+     *
+     * @return The last component of this path.
+     */
+    public final QName getLastComponent() {
+        return qname;
+    }
+
     /**
      * Describes whether schema path is|isn't absolute.
      *