Fixup Augmentable and Identifiable methods changing
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 24 Apr 2018 10:23:17 +0000 (12:23 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 4 Jun 2018 14:15:01 +0000 (14:15 +0000)
This is a fixup of the change in binding codegen, adjusting:
- getKey() -> key()
- setKey() -> withKey()
- getAugmentation() -> augmentation()

As a drive-by cleanup, some more references to CheckedFuture
are gone.

Change-Id: Ifa573f93d1776ab2db98524df4da63259e811767
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
src/main/java/org/opendaylight/controller/blueprint/ext/BindingContext.java

index fb950b8a58c2fa1e7a3fe1a1847ca3056ad93417..a1e96353264f14349e4980f8050b12dfc0cc17f9 100644 (file)
@@ -44,6 +44,7 @@ import org.xml.sax.SAXException;
  * @author Thomas Pantelis (originally; re-factored by Michael Vorburger.ch)
  */
 public abstract class BindingContext {
+    private static String GET_KEY_METHOD = "key";
 
     public static BindingContext create(final String logName, final Class<? extends DataObject> klass,
             final String appConfigListKeyValue) {
@@ -138,7 +139,7 @@ public abstract class BindingContext {
                 final String listKeyValue) throws InstantiationException, IllegalAccessException,
                 IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
             // We assume the yang list key type is string.
-            Identifier keyInstance = (Identifier) bindingClass.getMethod("getKey").getReturnType()
+            Identifier keyInstance = (Identifier) bindingClass.getMethod(GET_KEY_METHOD).getReturnType()
                     .getConstructor(String.class).newInstance(listKeyValue);
             InstanceIdentifier appConfigPath = InstanceIdentifier.builder((Class)bindingClass, keyInstance).build();
             return new ListBindingContext(bindingClass, appConfigPath, listKeyValue);