251959806f744c1de9829f9efd761ac11225168c
[yangtools.git] /
1 /*
2  * Copyright (c) 2024 PANTHEON.tech, 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.binding.impl;
9
10 import com.google.common.collect.ImmutableList;
11 import java.io.IOException;
12 import java.io.ObjectInputStream;
13 import java.io.ObjectOutputStream;
14 import java.io.ObjectStreamException;
15 import org.eclipse.jdt.annotation.NonNull;
16 import org.opendaylight.yangtools.binding.DataObject;
17 import org.opendaylight.yangtools.binding.DataObjectIdentifier;
18 import org.opendaylight.yangtools.binding.ExactDataObjectStep;
19
20 // FIXME: YANGTOOLS-1577: non-abstract
21 public abstract sealed class DataObjectIdentifierImpl<T extends DataObject>
22         extends AbstractDataObjectReference<T, ExactDataObjectStep<?>> implements DataObjectIdentifier<T>
23         permits DataObjectIdentifierWithKey {
24     @java.io.Serial
25     private static final long serialVersionUID = 1L;
26
27     DataObjectIdentifierImpl(final Iterable<? extends @NonNull ExactDataObjectStep<?>> steps) {
28         super(steps);
29     }
30
31     public static final @NonNull DataObjectIdentifierImpl<?> ofUnsafeSteps(
32             final ImmutableList<? extends @NonNull ExactDataObjectStep<?>> steps) {
33         // FIXME: YANGTOOLS-1577: implement this
34         throw new UnsupportedOperationException();
35     }
36
37     @Override
38     protected final Class<?> contract() {
39         return DataObjectIdentifier.class;
40     }
41
42     @java.io.Serial
43     private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException {
44         throwNSE();
45     }
46
47     @java.io.Serial
48     private void readObjectNoData() throws ObjectStreamException {
49         throwNSE();
50     }
51
52     @java.io.Serial
53     private void writeObject(final ObjectOutputStream stream) throws IOException {
54         throwNSE();
55     }
56 }