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

VCollections.src.org.violetlib.collections.impl.BindingImpl Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2023 Alan Snyder.
 * All rights reserved.
 *
 * You may not use, copy or modify this file, except in compliance with the license agreement. For details see
 * accompanying license terms.
 */

package org.violetlib.collections.impl;

import org.violetlib.collections.Binding;

import org.jetbrains.annotations.*;
import org.violetlib.annotations.Immutable;

/**

*/

public final @Immutable class BindingImpl
  implements Binding
{
    public static  @NotNull Binding create(@NotNull K key, @NotNull V value)
    {
        return new BindingImpl<>(key, value);
    }

    private final @NotNull K key;
    private final @NotNull V value;

    private BindingImpl(@NotNull K key, @NotNull V value)
    {
        this.key = key;
        this.value = value;
    }

    @Override
    public @NotNull K getKey()
    {
        return key;
    }

    @Override
    public @NotNull V getValue()
    {
        return value;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy