Add DataObject{Identifier,Reference}.Builder(.WithKey)
[yangtools.git] / binding / binding-spec / src / main / java / org / opendaylight / yangtools / yang / binding / KeyedInstanceIdentifierV2.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.binding;
9
10 import java.io.IOException;
11 import java.io.ObjectInput;
12 import org.opendaylight.yangtools.binding.DataObject;
13 import org.opendaylight.yangtools.binding.Key;
14 import org.opendaylight.yangtools.binding.KeyAware;
15
16 @Deprecated(since = "14.0.0", forRemoval = true)
17 final class KeyedInstanceIdentifierV2<T extends KeyAware<K> & DataObject, K extends Key<T>>
18         extends InstanceIdentifierV3<T> {
19     @java.io.Serial
20     private static final long serialVersionUID = 2L;
21
22     @SuppressWarnings("redundantModifier")
23     public KeyedInstanceIdentifierV2() {
24         // For Externalizable
25     }
26
27     @Override
28     public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
29         super.readExternal(in);
30         Key.class.cast(in.readObject());
31     }
32 }