- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 22 for firstNonNull (0.09 sec)
-
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) -
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) -
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) -
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) -
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) -
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) -
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) -
guava-gwt/src-super/com/google/common/cache/super/com/google/common/cache/LocalCache.java
* See the License for the specific language governing permissions and * limitations under the License. */ package com.google.common.cache; import static com.google.common.base.MoreObjects.firstNonNull; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import com.google.common.base.Equivalence; import com.google.common.base.Ticker;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Feb 27 19:19:19 UTC 2024 - 21.6K bytes - Viewed (0) -
guava/src/com/google/common/io/Resources.java
// e.g. Optional<URL> tryGetResource or boolean resourceExists public static URL getResource(String resourceName) { ClassLoader loader = MoreObjects.firstNonNull( Thread.currentThread().getContextClassLoader(), Resources.class.getClassLoader()); URL url = loader.getResource(resourceName); checkArgument(url != null, "resource %s not found.", resourceName);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Fri Aug 02 13:50:22 UTC 2024 - 7.5K bytes - Viewed (0) -
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)