Move getter method naming to BindingMapping
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / UnionTypeCodec.java
index b7779a6f90137d9516327c1f7cc8f75857073946..cf23b5019a185d5847e3bfc48aebe7752c8d33bd 100644 (file)
@@ -41,8 +41,8 @@ final class UnionTypeCodec extends ReflectionBasedCodec {
                 if (subtype instanceof LeafrefTypeDefinition) {
                     addLeafrefValueCodec(unionCls, unionType, bindingCodecContext, values, subtype);
                 } else {
-                    final Method valueGetter =
-                            unionCls.getMethod("get" + BindingMapping.getClassName(subtype.getQName()));
+                    final Method valueGetter = unionCls.getMethod(BindingMapping.GETTER_PREFIX
+                        + BindingMapping.getClassName(subtype.getQName()));
                     final Class<?> valueType = valueGetter.getReturnType();
                     final Codec<Object, Object> valueCodec = bindingCodecContext.getCodec(valueType, subtype);
 
@@ -91,8 +91,8 @@ final class UnionTypeCodec extends ReflectionBasedCodec {
 
         // get method via reflection from generated code according to
         // get_TypeName_Value method
-        final Method valueGetterParent = unionCls
-                .getMethod(new StringBuilder("get").append(typeName).append(className).append("Value").toString());
+        final Method valueGetterParent = unionCls.getMethod(new StringBuilder().append(BindingMapping.GETTER_PREFIX)
+            .append(typeName).append(className).append("Value").toString());
         final Class<?> returnType = valueGetterParent.getReturnType();
 
         // prepare codec of union subtype according to return type of referenced