Coverage Summary for Class: ImmutableSortedMapFauxverideShim (com.google.common.collect)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| ImmutableSortedMapFauxverideShim | 100% (1/1) | 10% (1/10) | 10% (1/10) |
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 import com.google.common.annotations.GwtIncompatible; 20 import java.util.function.BinaryOperator; 21 import java.util.function.Function; 22 import java.util.stream.Collector; 23 24 /** 25 * "Overrides" the {@link ImmutableMap} static methods that lack {@link ImmutableSortedMap} 26 * equivalents with deprecated, exception-throwing versions. See {@link 27 * ImmutableSortedSetFauxverideShim} for details. 28 * 29 * @author Chris Povirk 30 */ 31 @GwtIncompatible 32 abstract class ImmutableSortedMapFauxverideShim<K, V> extends ImmutableMap<K, V> { 33 /** 34 * Not supported. Use {@link ImmutableSortedMap#toImmutableSortedMap}, which offers better 35 * type-safety, instead. This method exists only to hide {@link ImmutableMap#toImmutableMap} from 36 * consumers of {@code ImmutableSortedMap}. 37 * 38 * @throws UnsupportedOperationException always 39 * @deprecated Use {@link ImmutableSortedMap#toImmutableSortedMap}. 40 */ 41 @Deprecated 42 public static <T, K, V> Collector<T, ?, ImmutableMap<K, V>> toImmutableMap( 43 Function<? super T, ? extends K> keyFunction, 44 Function<? super T, ? extends V> valueFunction) { 45 throw new UnsupportedOperationException(); 46 } 47 48 /** 49 * Not supported. Use {@link ImmutableSortedMap#toImmutableSortedMap}, which offers better 50 * type-safety, instead. This method exists only to hide {@link ImmutableMap#toImmutableMap} from 51 * consumers of {@code ImmutableSortedMap}. 52 * 53 * @throws UnsupportedOperationException always 54 * @deprecated Use {@link ImmutableSortedMap#toImmutableSortedMap}. 55 */ 56 @Deprecated 57 public static <T, K, V> Collector<T, ?, ImmutableMap<K, V>> toImmutableMap( 58 Function<? super T, ? extends K> keyFunction, 59 Function<? super T, ? extends V> valueFunction, 60 BinaryOperator<V> mergeFunction) { 61 throw new UnsupportedOperationException(); 62 } 63 64 /** 65 * Not supported. Use {@link ImmutableSortedMap#naturalOrder}, which offers better type-safety, 66 * instead. This method exists only to hide {@link ImmutableMap#builder} from consumers of {@code 67 * ImmutableSortedMap}. 68 * 69 * @throws UnsupportedOperationException always 70 * @deprecated Use {@link ImmutableSortedMap#naturalOrder}, which offers better type-safety. 71 */ 72 @Deprecated 73 public static <K, V> ImmutableSortedMap.Builder<K, V> builder() { 74 throw new UnsupportedOperationException(); 75 } 76 77 /** 78 * Not supported for ImmutableSortedMap. 79 * 80 * @throws UnsupportedOperationException always 81 * @deprecated Not supported for ImmutableSortedMap. 82 */ 83 @Deprecated 84 public static <K, V> ImmutableSortedMap.Builder<K, V> builderWithExpectedSize(int expectedSize) { 85 throw new UnsupportedOperationException(); 86 } 87 88 /** 89 * Not supported. <b>You are attempting to create a map that may contain a non-{@code Comparable} 90 * key.</b> Proper calls will resolve to the version in {@code ImmutableSortedMap}, not this dummy 91 * version. 92 * 93 * @throws UnsupportedOperationException always 94 * @deprecated <b>Pass a key of type {@code Comparable} to use {@link 95 * ImmutableSortedMap#of(Comparable, Object)}.</b> 96 */ 97 @Deprecated 98 public static <K, V> ImmutableSortedMap<K, V> of(K k1, V v1) { 99 throw new UnsupportedOperationException(); 100 } 101 102 /** 103 * Not supported. <b>You are attempting to create a map that may contain non-{@code Comparable} 104 * keys.</b> Proper calls will resolve to the version in {@code ImmutableSortedMap}, not this 105 * dummy version. 106 * 107 * @throws UnsupportedOperationException always 108 * @deprecated <b>Pass keys of type {@code Comparable} to use {@link 109 * ImmutableSortedMap#of(Comparable, Object, Comparable, Object)}.</b> 110 */ 111 @Deprecated 112 public static <K, V> ImmutableSortedMap<K, V> of(K k1, V v1, K k2, V v2) { 113 throw new UnsupportedOperationException(); 114 } 115 116 /** 117 * Not supported. <b>You are attempting to create a map that may contain non-{@code Comparable} 118 * keys.</b> Proper calls to will resolve to the version in {@code ImmutableSortedMap}, not this 119 * dummy version. 120 * 121 * @throws UnsupportedOperationException always 122 * @deprecated <b>Pass keys of type {@code Comparable} to use {@link 123 * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object)}.</b> 124 */ 125 @Deprecated 126 public static <K, V> ImmutableSortedMap<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3) { 127 throw new UnsupportedOperationException(); 128 } 129 130 /** 131 * Not supported. <b>You are attempting to create a map that may contain non-{@code Comparable} 132 * keys.</b> Proper calls will resolve to the version in {@code ImmutableSortedMap}, not this 133 * dummy version. 134 * 135 * @throws UnsupportedOperationException always 136 * @deprecated <b>Pass keys of type {@code Comparable} to use {@link 137 * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object, 138 * Comparable, Object)}.</b> 139 */ 140 @Deprecated 141 public static <K, V> ImmutableSortedMap<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) { 142 throw new UnsupportedOperationException(); 143 } 144 145 /** 146 * Not supported. <b>You are attempting to create a map that may contain non-{@code Comparable} 147 * keys.</b> Proper calls will resolve to the version in {@code ImmutableSortedMap}, not this 148 * dummy version. 149 * 150 * @throws UnsupportedOperationException always 151 * @deprecated <b>Pass keys of type {@code Comparable} to use {@link 152 * ImmutableSortedMap#of(Comparable, Object, Comparable, Object, Comparable, Object, 153 * Comparable, Object, Comparable, Object)}.</b> 154 */ 155 @Deprecated 156 public static <K, V> ImmutableSortedMap<K, V> of( 157 K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) { 158 throw new UnsupportedOperationException(); 159 } 160 161 // No copyOf() fauxveride; see ImmutableSortedSetFauxverideShim. 162 }