Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for safeContains (0.39 sec)

  1. guava/src/com/google/common/collect/Collections2.java

      }
    
      /**
       * Delegates to {@link Collection#contains}. Returns {@code false} if the {@code contains} method
       * throws a {@code ClassCastException} or {@code NullPointerException}.
       */
      static boolean safeContains(Collection<?> collection, @CheckForNull Object object) {
        checkNotNull(collection);
        try {
          return collection.contains(object);
        } catch (ClassCastException | NullPointerException e) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/Collections2.java

      }
    
      /**
       * Delegates to {@link Collection#contains}. Returns {@code false} if the {@code contains} method
       * throws a {@code ClassCastException} or {@code NullPointerException}.
       */
      static boolean safeContains(Collection<?> collection, @CheckForNull Object object) {
        checkNotNull(collection);
        try {
          return collection.contains(object);
        } catch (ClassCastException | NullPointerException e) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 22.8K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/ConcurrentHashMultiset.java

          @Override
          protected Set<E> delegate() {
            return delegate;
          }
    
          @Override
          public boolean contains(@CheckForNull Object object) {
            return object != null && Collections2.safeContains(delegate, object);
          }
    
          @Override
          public boolean containsAll(Collection<?> collection) {
            return standardContainsAll(collection);
          }
    
          @Override
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/Maps.java

        public boolean containsKey(@CheckForNull Object key) {
          return backingSet().contains(key);
        }
    
        @Override
        @CheckForNull
        public V get(@CheckForNull Object key) {
          if (Collections2.safeContains(backingSet(), key)) {
            @SuppressWarnings("unchecked") // unsafe, but Javadoc warns about it
            K k = (K) key;
            return function.apply(k);
          } else {
            return null;
          }
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 161.6K bytes
    - Viewed (0)
  5. guava/src/com/google/common/collect/Maps.java

          return getOrDefault(key, null);
        }
    
        @Override
        @CheckForNull
        public V getOrDefault(@CheckForNull Object key, @CheckForNull V defaultValue) {
          if (Collections2.safeContains(backingSet(), key)) {
            @SuppressWarnings("unchecked") // unsafe, but Javadoc warns about it
            K k = (K) key;
            return function.apply(k);
          } else {
            return defaultValue;
          }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 167.4K bytes
    - Viewed (0)
Back to top