Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for putIfAbsent (0.33 sec)

  1. src/main/java/org/codelibs/core/collection/CollectionsUtil.java

         * @see ConcurrentHashMap#putIfAbsent(Object, Object)
         */
        public static <K, V> V putIfAbsent(final ConcurrentMap<K, V> map, final K key, final V value) {
            final V exists = map.putIfAbsent(key, value);
            if (exists != null) {
                return exists;
            }
            return value;
        }
    
    Registered: Sat Dec 20 08:55:33 UTC 2025
    - Last Modified: Thu Jul 31 08:16:49 UTC 2025
    - 49.9K bytes
    - Viewed (0)
  2. guava/src/com/google/common/collect/Synchronized.java

          synchronized (mutex) {
            return delegate().put(key, value);
          }
        }
    
        @Override
        public @Nullable V putIfAbsent(K key, V value) {
          synchronized (mutex) {
            return delegate().putIfAbsent(key, value);
          }
        }
    
        @Override
        public boolean replace(K key, V oldValue, V newValue) {
          synchronized (mutex) {
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Fri Aug 08 15:11:10 UTC 2025
    - 56.9K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/collect/MapsTest.java

        assertThrows(UnsupportedOperationException.class, () -> unmod.replaceAll((k, v) -> v));
        assertThrows(UnsupportedOperationException.class, () -> unmod.putIfAbsent(3, "three"));
        assertThrows(UnsupportedOperationException.class, () -> unmod.replace(3, "three", "four"));
        assertThrows(UnsupportedOperationException.class, () -> unmod.replace(3, "four"));
        assertThrows(
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Thu Dec 11 22:56:33 UTC 2025
    - 65K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/MapMakerInternalMap.java

        checkNotNull(key);
        checkNotNull(value);
        int hash = hash(key);
        return segmentFor(hash).put(key, hash, value, false);
      }
    
      @CanIgnoreReturnValue
      @Override
      public @Nullable V putIfAbsent(K key, V value) {
        checkNotNull(key);
        checkNotNull(value);
        int hash = hash(key);
        return segmentFor(hash).put(key, hash, value, true);
      }
    
      @Override
    Registered: Fri Dec 26 12:43:10 UTC 2025
    - Last Modified: Mon Sep 22 18:35:44 UTC 2025
    - 89.9K bytes
    - Viewed (0)
Back to top