* Copyright (C) 2007 The Guava Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
import static com.google.common.base.Preconditions.checkNotNull;
BiMapbacked by an
EnumMapinstance for keys-to-values, and a
HashMapinstance for values-to-keys. Null keys are not permitted, but null values are. An
EnumHashBiMapand its inverse are both serializable.
See the Guava User Guide article on.
EnumBiMap, the new bimap has the same key type as the input bimap. Otherwise, the specified map must contain at least one mapping, in order to determine the key type.
mapthe map whose mappings are to be placed in this map
EnumHashBiMapinstance and contains no mappings
// Overriding these 3 methods to show that values may be null (but not keys)