Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for buildOrThrow (0.06 sec)

  1. android/guava-tests/test/com/google/common/collect/ImmutableMapTest.java

      public void testEmptyBuilder() {
        ImmutableMap<String, Integer> map = new Builder<String, Integer>().buildOrThrow();
        assertEquals(Collections.<String, Integer>emptyMap(), map);
      }
    
      public void testSingletonBuilder() {
        ImmutableMap<String, Integer> map = new Builder<String, Integer>().put("one", 1).buildOrThrow();
        assertMapEquals(map, "one", 1);
      }
    
      public void testBuilder() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 36.7K bytes
    - Viewed (0)
  2. guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java

          for (Entry<String, String> entry : entries) {
            checkNotNull(entry);
            builder.put(entry.getKey(), entry.getValue());
          }
          return builder.buildOrThrow();
        }
      }
    
      public static class ImmutableMapCopyOfGenerator extends TestStringMapGenerator {
        @Override
        protected Map<String, String> create(Entry<String, String>[] entries) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sun Aug 10 19:54:19 UTC 2025
    - 8.6K bytes
    - Viewed (0)
  3. android/guava-testlib/src/com/google/common/collect/testing/google/MapGenerators.java

          for (Entry<String, String> entry : entries) {
            checkNotNull(entry);
            builder.put(entry.getKey(), entry.getValue());
          }
          return builder.buildOrThrow();
        }
      }
    
      public static class ImmutableMapCopyOfGenerator extends TestStringMapGenerator {
        @Override
        protected Map<String, String> create(Entry<String, String>[] entries) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sun Aug 10 19:54:19 UTC 2025
    - 8.6K bytes
    - Viewed (0)
  4. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableBiMap.java

        }
    
        @Override
        public ImmutableBiMap<K, V> build() {
          return buildOrThrow();
        }
    
        @Override
        public ImmutableBiMap<K, V> buildOrThrow() {
          ImmutableMap<K, V> map = super.buildOrThrow();
          if (map.isEmpty()) {
            return of();
          }
          return new RegularImmutableBiMap<K, V>(super.buildOrThrow());
        }
    
        @Override
        ImmutableBiMap<K, V> buildJdkBacked() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Aug 06 18:32:41 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/ImmutableMap.java

        @Nullable Object[] alternatingKeysAndValues;
        int size;
        boolean entriesUsed;
    
        /**
         * If non-null, a duplicate key we found in a previous buildKeepingLast() or buildOrThrow()
         * call. A later buildOrThrow() can simply report this duplicate immediately.
         */
        @Nullable DuplicateKey duplicateKey;
    
        /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 41.2K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/collect/TableCollectorsTest.java

                new ImmutableTable.Builder<String, String, Integer>()
                    .put("one", "uno", 1)
                    .put("two", "dos", 2)
                    .put("three", "tres", 3)
                    .buildOrThrow(),
                immutableCell("one", "uno", 1),
                immutableCell("two", "dos", 2),
                immutableCell("three", "tres", 3));
      }
    
      public void testToImmutableTableConflict() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 12.5K bytes
    - Viewed (0)
  7. android/guava-testlib/src/com/google/common/collect/testing/google/ReflectionFreeAssertThrows.java

              .put(VerifyException.class, e -> e instanceof VerifyException)
              .putAll(PlatformSpecificExceptionBatch.PLATFORM.exceptions())
              .buildOrThrow();
    
      private ReflectionFreeAssertThrows() {}
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 6.3K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/collect/RegularImmutableMap.java

       * Builder.buildKeepingLast(). The same Builder might be called with buildKeepingLast() and then
       * buildOrThrow(), or vice versa. So in particular, if we modify alternatingKeysAndValues to
       * eliminate duplicate keys (for buildKeepingLast()) then we have to ensure that a later call to
       * buildOrThrow() will still throw as if the duplicates had not been eliminated. And the exception
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 22.5K bytes
    - Viewed (0)
  9. guava/src/com/google/common/collect/ImmutableMap.java

         *
         * <p>Prefer the equivalent method {@link #buildOrThrow()} to make it explicit that the method
         * will throw an exception if there are duplicate keys. The {@code build()} method will soon be
         * deprecated.
         *
         * @throws IllegalArgumentException if duplicate keys were added
         */
        public ImmutableMap<K, V> build() {
          return buildOrThrow();
        }
    
        /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 44.3K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/ImmutableBiMap.java

         * <p>Prefer the equivalent method {@link #buildOrThrow()} to make it explicit that the method
         * will throw an exception if there are duplicate keys or values. The {@code build()} method
         * will soon be deprecated.
         *
         * @throws IllegalArgumentException if duplicate keys or values were added
         */
        @Override
        public ImmutableBiMap<K, V> build() {
          return buildOrThrow();
        }
    
        /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 22.2K bytes
    - Viewed (0)
Back to top