Home | History | Annotate | Download | only in collect
      1 /*
      2  * Copyright (C) 2009 The Guava Authors
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  * http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.google.common.collect;
     18 
     19 /**
     20  * "Overrides" the {@link ImmutableMap} static methods that lack
     21  * {@link ImmutableSortedMap} equivalents with deprecated, exception-throwing
     22  * versions. See {@link ImmutableSortedSetFauxverideShim} for details.
     23  *
     24  * @author Chris Povirk
     25  */
     26 abstract class ImmutableSortedMapFauxverideShim<K, V>
     27     extends ImmutableMap<K, V> {
     28   /**
     29    * Not supported. Use {@link ImmutableSortedMap#naturalOrder}, which offers
     30    * better type-safety, instead. This method exists only to hide
     31    * {@link ImmutableMap#builder} from consumers of {@code ImmutableSortedMap}.
     32    *
     33    * @throws UnsupportedOperationException always
     34    * @deprecated Use {@link ImmutableSortedMap#naturalOrder}, which offers
     35    *     better type-safety.
     36    */
     37   @Deprecated public static <K, V> ImmutableSortedMap.Builder<K, V> builder() {
     38     throw new UnsupportedOperationException();
     39   }
     40 
     41   /**
     42    * Not supported. <b>You are attempting to create a map that may contain a
     43    * non-{@code Comparable} key.</b> Proper calls will resolve to the version in
     44    * {@code ImmutableSortedMap}, not this dummy version.
     45    *
     46    * @throws UnsupportedOperationException always
     47    * @deprecated <b>Pass a key of type {@code Comparable} to use {@link
     48    *     ImmutableSortedMap#of(Comparable, Object)}.</b>
     49    */
     50   @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(K k1, V v1) {
     51     throw new UnsupportedOperationException();
     52   }
     53 
     54   /**
     55    * Not supported. <b>You are attempting to create a map that may contain
     56    * non-{@code Comparable} keys.</b> Proper calls will resolve to the version
     57    * in {@code ImmutableSortedMap}, not this dummy version.
     58    *
     59    * @throws UnsupportedOperationException always
     60    * @deprecated <b>Pass keys of type {@code Comparable} to use {@link
     61    *     ImmutableSortedMap#of(Comparable, Object, Comparable, Object)}.</b>
     62    */
     63   @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(
     64       K k1, V v1, K k2, V v2) {
     65     throw new UnsupportedOperationException();
     66   }
     67 
     68   /**
     69    * Not supported. <b>You are attempting to create a map that may contain
     70    * non-{@code Comparable} keys.</b> Proper calls to will resolve to the
     71    * version in {@code ImmutableSortedMap}, not this dummy version.
     72    *
     73    * @throws UnsupportedOperationException always
     74    * @deprecated <b>Pass keys of type {@code Comparable} to use {@link
     75    *     ImmutableSortedMap#of(Comparable, Object, Comparable, Object,
     76    *     Comparable, Object)}.</b>
     77    */
     78   @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(
     79       K k1, V v1, K k2, V v2, K k3, V v3) {
     80     throw new UnsupportedOperationException();
     81   }
     82 
     83   /**
     84    * Not supported. <b>You are attempting to create a map that may contain
     85    * non-{@code Comparable} keys.</b> Proper calls will resolve to the version
     86    * in {@code ImmutableSortedMap}, not this dummy version.
     87    *
     88    * @throws UnsupportedOperationException always
     89    * @deprecated <b>Pass keys of type {@code Comparable} to use {@link
     90    *     ImmutableSortedMap#of(Comparable, Object, Comparable, Object,
     91    *     Comparable, Object, Comparable, Object)}.</b>
     92    */
     93   @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(
     94       K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) {
     95     throw new UnsupportedOperationException();
     96   }
     97 
     98   /**
     99    * Not supported. <b>You are attempting to create a map that may contain
    100    * non-{@code Comparable} keys.</b> Proper calls will resolve to the version
    101    * in {@code ImmutableSortedMap}, not this dummy version.
    102    *
    103    * @throws UnsupportedOperationException always
    104    * @deprecated <b>Pass keys of type {@code Comparable} to use {@link
    105    *     ImmutableSortedMap#of(Comparable, Object, Comparable, Object,
    106    *     Comparable, Object, Comparable, Object, Comparable, Object)}.</b>
    107    */
    108   @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(
    109       K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) {
    110     throw new UnsupportedOperationException();
    111   }
    112 
    113   // No copyOf() fauxveride; see ImmutableSortedSetFauxverideShim.
    114 }
    115