import java.util.List;
import java.util.concurrent.Callable;
import org.opendaylight.mdsal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.mdsal.binding.model.api.GeneratedType;
+import org.opendaylight.mdsal.binding.model.api.Type;
import org.opendaylight.mdsal.binding.runtime.api.RuntimeGeneratedUnion;
import org.opendaylight.mdsal.binding.spec.naming.BindingMapping;
import org.opendaylight.yangtools.concepts.IllegalArgumentCodec;
final BindingCodecContext codecContext) {
return () -> {
final List<String> unionProperties = extractUnionProperties(codecContext.getRuntimeContext()
- .getTypeWithSchema(unionCls).getKey());
+ .getTypeWithSchema(unionCls).javaType());
final List<TypeDefinition<?>> unionTypes = unionType.getTypes();
verify(unionTypes.size() == unionProperties.size(), "Mismatched union types %s and properties %s",
unionTypes, unionProperties);
};
}
- private static List<String> extractUnionProperties(final GeneratedType type) {
+ private static List<String> extractUnionProperties(final Type type) {
verify(type instanceof GeneratedTransferObject, "Unexpected runtime type %s", type);
GeneratedTransferObject gto = (GeneratedTransferObject) type;