import static java.util.Objects.requireNonNull;
+import org.opendaylight.yangtools.concepts.AbstractIllegalArgumentCodec;
import org.opendaylight.yangtools.concepts.IllegalArgumentCodec;
-final class CompositeValueCodec extends ValueTypeCodec {
+final class CompositeValueCodec extends AbstractIllegalArgumentCodec<Object, Object> {
private final EncapsulatedValueCodec typeObjectCodec;
@SuppressWarnings("rawtypes")
// FIXME: specialize for the two possibilities
@SuppressWarnings("unchecked")
@Override
- public Object deserialize(final Object input) {
+ protected Object deserializeImpl(final Object input) {
+ // FIXME: throws NPE on unrepresentable InstanceIdentifierCodec
return typeObjectCodec.deserialize(valueCodec.deserialize(input));
}
@SuppressWarnings("unchecked")
@Override
- public Object serialize(final Object input) {
+ protected Object serializeImpl(final Object input) {
return valueCodec.serialize(typeObjectCodec.serialize(input));
}
}
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
-final class UnionTypeCodec extends ValueTypeCodec {
+final class UnionTypeCodec implements IllegalArgumentCodec<Object, Object> {
private final ImmutableSet<UnionValueOptionContext> typeCodecs;
private final Class<?> unionClass;
+++ /dev/null
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.mdsal.binding.dom.codec.impl;
-
-import org.opendaylight.yangtools.concepts.IllegalArgumentCodec;
-
-/**
- * Value codec, which serializes / deserializes values from DOM simple values.
- */
-// FIXME: IllegalArgumentCodec is perhaps not appropriate here due to null behavior
-abstract class ValueTypeCodec implements IllegalArgumentCodec<Object, Object> {
-
-}