Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for ImmutableEnumMap (0.18 sec)

  1. android/guava/src/com/google/common/collect/ImmutableEnumMap.java

            Entry<K, V> entry = getOnlyElement(map.entrySet());
            return ImmutableMap.of(entry.getKey(), entry.getValue());
          default:
            return new ImmutableEnumMap<>(map);
        }
      }
    
      private final transient EnumMap<K, V> delegate;
    
      private ImmutableEnumMap(EnumMap<K, V> delegate) {
        this.delegate = delegate;
        checkArgument(!delegate.isEmpty());
      }
    
      @Override
      UnmodifiableIterator<K> keyIterator() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  2. guava/src/com/google/common/collect/ImmutableEnumMap.java

            Entry<K, V> entry = getOnlyElement(map.entrySet());
            return ImmutableMap.of(entry.getKey(), entry.getValue());
          default:
            return new ImmutableEnumMap<>(map);
        }
      }
    
      private final transient EnumMap<K, V> delegate;
    
      private ImmutableEnumMap(EnumMap<K, V> delegate) {
        this.delegate = delegate;
        checkArgument(!delegate.isEmpty());
      }
    
      @Override
      UnmodifiableIterator<K> keyIterator() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/collect/ImmutableEnumMapTest.java

            map.put(entry.getKey(), entry.getValue());
          }
          return Maps.immutableEnumMap(map);
        }
      }
    
      @J2ktIncompatible
      @GwtIncompatible // suite
      public static Test suite() {
        TestSuite suite = new TestSuite();
        suite.addTest(
            MapTestSuiteBuilder.using(new ImmutableEnumMapGenerator())
                .named("Maps.immutableEnumMap")
                .withFeatures(CollectionSize.ANY, SERIALIZABLE, ALLOWS_NULL_QUERIES)
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  4. android/guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java

          Map<AnEnum, String> map = Maps.newHashMap();
          for (Entry<AnEnum, String> entry : entries) {
            checkNotNull(entry);
            map.put(entry.getKey(), entry.getValue());
          }
          return Maps.immutableEnumMap(map);
        }
      }
    
      public static class ImmutableMapCopyOfEnumMapGenerator extends TestEnumMapGenerator {
        @Override
        protected Map<AnEnum, String> create(Entry<AnEnum, String>[] entries) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/CollectCollectors.java

          } else {
            other.map.forEach(this::put);
            return this;
          }
        }
    
        ImmutableMap<K, V> toImmutableMap() {
          return (map == null) ? ImmutableMap.<K, V>of() : ImmutableEnumMap.asImmutable(map);
        }
      }
    
      @GwtIncompatible
      static <T extends @Nullable Object, K extends Comparable<? super K>, V>
          Collector<T, ?, ImmutableRangeMap<K, V>> toImmutableRangeMap(
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/Maps.java

       * @since 14.0
       */
      @GwtCompatible(serializable = true)
      public static <K extends Enum<K>, V> ImmutableMap<K, V> immutableEnumMap(
          Map<K, ? extends V> map) {
        if (map instanceof ImmutableEnumMap) {
          @SuppressWarnings("unchecked") // safe covariant cast
          ImmutableEnumMap<K, V> result = (ImmutableEnumMap<K, V>) map;
          return result;
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 161.6K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/Maps.java

       * @since 14.0
       */
      @GwtCompatible(serializable = true)
      public static <K extends Enum<K>, V> ImmutableMap<K, V> immutableEnumMap(
          Map<K, ? extends V> map) {
        if (map instanceof ImmutableEnumMap) {
          @SuppressWarnings("unchecked") // safe covariant cast
          ImmutableEnumMap<K, V> result = (ImmutableEnumMap<K, V>) map;
          return result;
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 167.4K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/collect/ImmutableMapTest.java

      public void testCopyOfEnumMap() {
        EnumMap<AnEnum, String> map = new EnumMap<>(AnEnum.class);
        map.put(AnEnum.B, "foo");
        map.put(AnEnum.C, "bar");
        assertTrue(ImmutableMap.copyOf(map) instanceof ImmutableEnumMap);
      }
    
      @J2ktIncompatible
      @GwtIncompatible // SerializableTester
      public void testViewSerialization() {
        Map<String, Integer> map = ImmutableMap.of("one", 1, "two", 2, "three", 3);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 41.1K bytes
    - Viewed (0)
  9. guava/src/com/google/common/collect/ImmutableMap.java

        EnumMap<K, V> copy = new EnumMap<>((EnumMap<K, ? extends V>) original);
        for (Entry<K, V> entry : copy.entrySet()) {
          checkEntryNotNull(entry.getKey(), entry.getValue());
        }
        return ImmutableEnumMap.asImmutable(copy);
      }
    
      static final Entry<?, ?>[] EMPTY_ENTRY_ARRAY = new Entry<?, ?>[0];
    
      abstract static class IteratorBasedImmutableMap<K, V> extends ImmutableMap<K, V> {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 44.6K bytes
    - Viewed (0)
Back to top