Merge branch 'master' of ../controller
[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 org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.concepts.Immutable;
14
15 /**
16  * A {@link Map} which cannot be modified and supports efficient conversion to a {@link ModifiableMapPhase}.
17  *
18  * @param <K> the type of keys maintained by this map
19  * @param <V> the type of mapped values
20  */
21 @Beta
22 public interface UnmodifiableMapPhase<K, V> extends Map<K, V>, Immutable {
23     /**
24      * Return an isolated modifiable version of this map. Its mappings must match the mappings present in this map. Any
25      * modification of the returned map must not be affect the contents of this map.
26      *
27      * @return An modifiable version of this map.
28      */
29     @NonNull ModifiableMapPhase<K, V> toModifiableMap();
30 }