001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.collections4;
018
019import java.util.Map;
020
021/**
022 * The "write" subset of the {@link Map} interface.
023 * <p>
024 * NOTE: in the original {@link Map} interface, {@link Map#put(Object, Object)} is known
025 * to have the same return type as {@link Map#get(Object)}, namely {@code V}. {@link Put}
026 * makes no assumptions in this regard (there is no association with, nor even knowledge
027 * of, a "reading" interface) and thus defines {@link #put(Object, Object)} as returning
028 * {@link Object}.
029 *
030 * @since 4.0
031 * @version $Id: Put.html 972421 2015-11-14 20:00:04Z tn $
032 *
033 * @see Get
034 */
035public interface Put<K, V> {
036
037    /**
038     * @see Map#clear()
039     */
040    void clear();
041
042    /**
043     * Note that the return type is Object, rather than V as in the Map interface.
044     * See the class Javadoc for further info.
045     *
046     * @see Map#put(Object, Object)
047     */
048    Object put(K key, V value);
049
050    /**
051     * @see Map#putAll(Map)
052     */
053    void putAll(Map<? extends K, ? extends V> t);
054
055}