1090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson/*
21d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert * Copyright (C) 2009 The Guava Authors
3090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson *
4090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * Licensed under the Apache License, Version 2.0 (the "License");
5090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * you may not use this file except in compliance with the License.
6090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * You may obtain a copy of the License at
7090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson *
8090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * http://www.apache.org/licenses/LICENSE-2.0
9090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson *
10090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * Unless required by applicable law or agreed to in writing, software
11090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * distributed under the License is distributed on an "AS IS" BASIS,
12090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * See the License for the specific language governing permissions and
14090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * limitations under the License.
15090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson */
16090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson
17090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilsonpackage com.google.common.collect;
18090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson
19090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilsonimport com.google.common.annotations.GwtCompatible;
20090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson
21090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson/**
22090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * "Overrides" the {@link ImmutableMap} static methods that lack
23090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * {@link ImmutableSortedMap} equivalents with deprecated, exception-throwing
24090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * versions. See {@link ImmutableSortedSetFauxverideShim} for details.
25090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson *
26090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * @author Chris Povirk
27090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson */
28090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson@GwtCompatible
29090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilsonabstract class ImmutableSortedMapFauxverideShim<K, V>
30090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson    extends ImmutableMap<K, V> {
31090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  /**
32090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * Not supported. Use {@link ImmutableSortedMap#naturalOrder}, which offers
33090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * better type-safety, instead. This method exists only to hide
34090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * {@link ImmutableMap#builder} from consumers of {@code ImmutableSortedMap}.
35090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *
36090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @throws UnsupportedOperationException always
37090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @deprecated Use {@link ImmutableSortedMap#naturalOrder}, which offers
38090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *     better type-safety.
39090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   */
40090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  @Deprecated public static <K, V> ImmutableSortedMap.Builder<K, V> builder() {
41090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson    throw new UnsupportedOperationException();
42090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  }
43090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson
44090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  /**
45090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * Not supported. <b>You are attempting to create a map that may contain a
46090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * non-{@code Comparable} key.</b> Proper calls will resolve to the version in
47090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * {@code ImmutableSortedMap}, not this dummy version.
48090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *
49090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @throws UnsupportedOperationException always
50090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @deprecated <b>Pass a key of type {@code Comparable} to use {@link
51090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *     ImmutableSortedMap#of(Comparable, Object)}.</b>
52090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   */
53090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(K k1, V v1) {
54090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson    throw new UnsupportedOperationException();
55090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  }
56090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson
57090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  /**
58090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * Not supported. <b>You are attempting to create a map that may contain
59090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * non-{@code Comparable} keys.</b> Proper calls will resolve to the version
60090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * in {@code ImmutableSortedMap}, not this dummy version.
61090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *
62090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @throws UnsupportedOperationException always
63090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @deprecated <b>Pass keys of type {@code Comparable} to use {@link
64090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *     ImmutableSortedMap#of(Comparable, Object, Comparable, Object)}.</b>
65090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   */
66090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(
67090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson      K k1, V v1, K k2, V v2) {
68090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson    throw new UnsupportedOperationException();
69090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  }
70090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson
71090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  /**
72090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * Not supported. <b>You are attempting to create a map that may contain
73090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * non-{@code Comparable} keys.</b> Proper calls to will resolve to the
74090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * version in {@code ImmutableSortedMap}, not this dummy version.
75090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *
76090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @throws UnsupportedOperationException always
77090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @deprecated <b>Pass keys of type {@code Comparable} to use {@link
78090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *     ImmutableSortedMap#of(Comparable, Object, Comparable, Object,
79090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *     Comparable, Object)}.</b>
80090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   */
81090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(
82090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson      K k1, V v1, K k2, V v2, K k3, V v3) {
83090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson    throw new UnsupportedOperationException();
84090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  }
85090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson
86090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  /**
87090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * Not supported. <b>You are attempting to create a map that may contain
88090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * non-{@code Comparable} keys.</b> Proper calls will resolve to the version
89090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * in {@code ImmutableSortedMap}, not this dummy version.
90090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *
91090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @throws UnsupportedOperationException always
92090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @deprecated <b>Pass keys of type {@code Comparable} to use {@link
93090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *     ImmutableSortedMap#of(Comparable, Object, Comparable, Object,
94090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *     Comparable, Object, Comparable, Object)}.</b>
95090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   */
96090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(
97090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson      K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) {
98090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson    throw new UnsupportedOperationException();
99090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  }
100090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson
101090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  /**
102090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * Not supported. <b>You are attempting to create a map that may contain
103090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * non-{@code Comparable} keys.</b> Proper calls will resolve to the version
104090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * in {@code ImmutableSortedMap}, not this dummy version.
105090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *
106090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @throws UnsupportedOperationException always
107090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   * @deprecated <b>Pass keys of type {@code Comparable} to use {@link
108090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *     ImmutableSortedMap#of(Comparable, Object, Comparable, Object,
109090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   *     Comparable, Object, Comparable, Object, Comparable, Object)}.</b>
110090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson   */
111090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  @Deprecated public static <K, V> ImmutableSortedMap<K, V> of(
112090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson      K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) {
113090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson    throw new UnsupportedOperationException();
114090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  }
115090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson
116090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson  // No copyOf() fauxveride; see ImmutableSortedSetFauxverideShim.
117090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson}
118