All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opendaylight.yangtools.binding.impl.DataObjectReferenceWithKey Maven / Gradle / Ivy

/*
 * Copyright (c) 2024 PANTHEON.tech, s.r.o. 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.yangtools.binding.impl;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamException;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.binding.DataObjectIdentifier;
import org.opendaylight.yangtools.binding.DataObjectReference.WithKey;
import org.opendaylight.yangtools.binding.DataObjectStep;
import org.opendaylight.yangtools.binding.EntryObject;
import org.opendaylight.yangtools.binding.Key;
import org.opendaylight.yangtools.binding.KeyStep;

public final class DataObjectReferenceWithKey, K extends Key>
        extends DataObjectReferenceImpl implements WithKey {
    @java.io.Serial
    private static final long serialVersionUID = 1L;

    public DataObjectReferenceWithKey(final Iterable> steps) {
        super(steps);
    }

    @Override
    public KeyStep lastStep() {
        return getLast(steps());
    }

    @Override
    public DataObjectReferenceBuilderWithKey toBuilder() {
        return new DataObjectReferenceBuilderWithKey<>(this);
    }

    @Override
    public DataObjectIdentifier.WithKey toIdentifier() {
        throw new UnsupportedOperationException(this + " contains inexact steps");
    }

    @java.io.Serial
    private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException {
        throwNSE();
    }

    @java.io.Serial
    private void readObjectNoData() throws ObjectStreamException {
        throwNSE();
    }

    @java.io.Serial
    private void writeObject(final ObjectOutputStream stream) throws IOException {
        throwNSE();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy