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

org.opendaylight.yangtools.binding.lib.AbstractEntryObject 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.lib;

import static java.util.Objects.requireNonNull;

import java.util.Map;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.binding.Augmentation;
import org.opendaylight.yangtools.binding.EntryObject;
import org.opendaylight.yangtools.binding.Key;

/**
 * Abstract base class for implementations of {@link EntryObject}.
 *
 * @param  {@link EntryObject} type
 * @param  {@link Key} type
 */
public abstract class AbstractEntryObject, K extends Key>
        extends AbstractAugmentable implements EntryObject {
    private final @NonNull K key;

    protected AbstractEntryObject(final Map>, Augmentation> augmentations,
            final K key) {
        super(augmentations);
        this.key = requireNonNull(key);
    }

    @Override
    public final K key() {
        return key;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy