import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Method;
-import org.opendaylight.yangtools.concepts.Codec;
+import org.opendaylight.yangtools.concepts.IllegalArgumentCodec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(UnionValueOptionContext.class);
private final Class<?> bindingType;
- private final Codec<Object,Object> codec;
+ private final IllegalArgumentCodec<Object,Object> codec;
private final MethodHandle getter;
private final MethodHandle unionCtor;
UnionValueOptionContext(final Class<?> unionType, final Class<?> valueType, final Method getter,
- final Codec<Object, Object> codec) {
+ final IllegalArgumentCodec<Object, Object> codec) {
this.bindingType = requireNonNull(valueType);
this.codec = requireNonNull(codec);
return getter.invokeExact(input);
} catch (Throwable e) {
Throwables.throwIfUnchecked(e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
}
}