Implement efficient hashCode for OffsetMaps
[yangtools.git] / common / util / src / main / java / org / opendaylight / yangtools / util / UnmodifiableMapPhase.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. 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.util;
9
10 import com.google.common.annotations.Beta;
11 import java.util.Map;
12 import javax.annotation.Nonnull;
13
14 /**
15  * A {@link Map} which cannot be modified and supports efficient conversion to a {@link ModifiableMapPhase}.
16  *
17  * @param <K> the type of keys maintained by this map
18  * @param <V> the type of mapped values
19  */
20 @Beta
21 public interface UnmodifiableMapPhase<K, V> extends Map<K, V> {
22     /**
23      * Return an isolated modifiable version of this map. Its mappings must match the mappings present in this map. Any
24      * modification of the returned map must not be affect the contents of this map.
25      *
26      * @return An modifiable version of this map.
27      */
28     @Nonnull ModifiableMapPhase<K, V> toModifiableMap();
29 }