Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for firstNonNull (0.1 sec)

  1. android/guava-tests/test/com/google/common/base/MoreObjectsTest.java

      public void testFirstNonNull_withNonNull() {
        String s1 = "foo";
        String s2 = MoreObjects.firstNonNull(s1, "bar");
        assertSame(s1, s2);
    
        Long n1 = 42L;
        Long n2 = MoreObjects.firstNonNull(null, n1);
        assertSame(n1, n2);
    
        Boolean b1 = true;
        Boolean b2 = MoreObjects.firstNonNull(b1, null);
        assertSame(b1, b2);
      }
    
      public void testFirstNonNull_throwsNullPointerException() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Sep 17 18:14:12 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/base/MoreObjectsTest.java

      public void testFirstNonNull_withNonNull() {
        String s1 = "foo";
        String s2 = MoreObjects.firstNonNull(s1, "bar");
        assertSame(s1, s2);
    
        Long n1 = 42L;
        Long n2 = MoreObjects.firstNonNull(null, n1);
        assertSame(n1, n2);
    
        Boolean b1 = true;
        Boolean b2 = MoreObjects.firstNonNull(b1, null);
        assertSame(b1, b2);
      }
    
      public void testFirstNonNull_throwsNullPointerException() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Sep 17 18:14:12 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/eventbus/SubscriberRegistry.java

          if (eventSubscribers == null) {
            CopyOnWriteArraySet<Subscriber> newSet = new CopyOnWriteArraySet<>();
            eventSubscribers =
                MoreObjects.firstNonNull(subscribers.putIfAbsent(eventType, newSet), newSet);
          }
    
          eventSubscribers.addAll(eventMethodsInListener);
        }
      }
    
      /** Unregisters all subscribers on the given listener object. */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 15:16:45 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/cache/CacheBuilder.java

        keyEquivalence = checkNotNull(equivalence);
        return this;
      }
    
      Equivalence<Object> getKeyEquivalence() {
        return MoreObjects.firstNonNull(keyEquivalence, getKeyStrength().defaultEquivalence());
      }
    
      /**
       * Sets a custom {@code Equivalence} strategy for comparing values.
       *
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 52K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/base/MoreObjects.java

       * @throws NullPointerException if both {@code first} and {@code second} are null
       * @since 18.0 (since 3.0 as {@code Objects.firstNonNull()}).
       */
      public static <T> T firstNonNull(@CheckForNull T first, @CheckForNull T second) {
        if (first != null) {
          return first;
        }
        if (second != null) {
          return second;
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 10 15:41:27 UTC 2024
    - 16.1K bytes
    - Viewed (0)
  6. guava/src/com/google/common/cache/CacheBuilder.java

        keyEquivalence = checkNotNull(equivalence);
        return this;
      }
    
      Equivalence<Object> getKeyEquivalence() {
        return MoreObjects.firstNonNull(keyEquivalence, getKeyStrength().defaultEquivalence());
      }
    
      /**
       * Sets a custom {@code Equivalence} strategy for comparing values.
       *
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 19:07:49 UTC 2024
    - 51.6K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/ImmutableTable.java

       *
       * @throws NullPointerException if {@code columnKey} is {@code null}
       */
      @Override
      public ImmutableMap<R, V> column(C columnKey) {
        checkNotNull(columnKey, "columnKey");
        return MoreObjects.firstNonNull(
            (ImmutableMap<R, V>) columnMap().get(columnKey), ImmutableMap.<R, V>of());
      }
    
      @Override
      public ImmutableSet<C> columnKeySet() {
        return columnMap().keySet();
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 17.5K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/FilteredEntryMultimap.java

      @Override
      public boolean containsKey(@CheckForNull Object key) {
        return asMap().get(key) != null;
      }
    
      @Override
      public Collection<V> removeAll(@CheckForNull Object key) {
        return MoreObjects.firstNonNull(asMap().remove(key), unmodifiableEmptyCollection());
      }
    
      Collection<V> unmodifiableEmptyCollection() {
        // These return false, rather than throwing a UOE, on remove calls.
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/FilteredEntryMultimap.java

      @Override
      public boolean containsKey(@CheckForNull Object key) {
        return asMap().get(key) != null;
      }
    
      @Override
      public Collection<V> removeAll(@CheckForNull Object key) {
        return MoreObjects.firstNonNull(asMap().remove(key), unmodifiableEmptyCollection());
      }
    
      Collection<V> unmodifiableEmptyCollection() {
        // These return false, rather than throwing a UOE, on remove calls.
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/TreeMultiset.java

        private AvlNode<E> ceiling(Comparator<? super E> comparator, @ParametricNullness E e) {
          int cmp = comparator.compare(e, getElement());
          if (cmp < 0) {
            return (left == null) ? this : MoreObjects.firstNonNull(left.ceiling(comparator, e), this);
          } else if (cmp == 0) {
            return this;
          } else {
            return (right == null) ? null : right.ceiling(comparator, e);
          }
        }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 34.1K bytes
    - Viewed (0)
Back to top