2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.binding.lib;
10 import java.io.IOException;
11 import java.io.ObjectInput;
12 import java.io.ObjectOutput;
13 import java.io.ObjectStreamException;
15 final class KIIv4<T extends KeyAware<K> & DataObject, K extends Key<T>> extends IIv4<T> {
17 private static final long serialVersionUID = 2L;
21 @SuppressWarnings("redundantModifier")
26 KIIv4(final KeyedInstanceIdentifier<T, K> source) {
28 key = source.getKey();
32 public void writeExternal(final ObjectOutput out) throws IOException {
33 super.writeExternal(out);
38 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
39 super.readExternal(in);
40 key = (K) in.readObject();
45 Object readResolve() throws ObjectStreamException {
46 return new KeyedInstanceIdentifier<>(new KeyStep<>(getTargetType(), key), getPathArguments(),
47 isWildcarded(), getHash());