- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for fromNullable (0.81 sec)
-
guava-tests/test/com/google/common/base/OptionalTest.java
} public void testFromNullable() { Optional<String> optionalName = Optional.fromNullable("bob"); assertEquals("bob", optionalName.get()); } public void testFromNullable_null() { // not promised by spec, but easier to test assertSame(Optional.absent(), Optional.fromNullable(null)); } public void testIsPresent_no() { assertFalse(Optional.absent().isPresent()); }
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Tue Oct 28 16:03:47 UTC 2025 - 10.5K bytes - Viewed (0) -
android/guava/src/com/google/common/base/Optional.java
return Absent.withType(); } /** * Returns an {@code Optional} instance containing the given non-null reference. To have {@code * null} treated as {@link #absent}, use {@link #fromNullable} instead. * * <p><b>Comparison to {@code java.util.Optional}:</b> no differences. * * @throws NullPointerException if {@code reference} is null */ public static <T> Optional<T> of(T reference) {
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Wed Jun 04 13:03:16 UTC 2025 - 15.4K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/cache/CacheBuilderFactory.java
private static final Function<Object, Optional<?>> NULLABLE_TO_OPTIONAL = new Function<Object, Optional<?>>() { @Override public Optional<?> apply(@Nullable Object obj) { return Optional.fromNullable(obj); } }; private static final Function<Optional<?>, @Nullable Object> OPTIONAL_TO_NULLABLE = new Function<Optional<?>, @Nullable Object>() { @Override
Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Tue Jul 08 18:32:10 UTC 2025 - 8.4K bytes - Viewed (0) -
android/guava/src/com/google/common/net/InternetDomainName.java
if (i > 0 && matchesType( desiredType, Optional.fromNullable(PublicSuffixPatterns.UNDER.get(ancestorName)))) { return i - 1; } if (matchesType( desiredType, Optional.fromNullable(PublicSuffixPatterns.EXACT.get(ancestorName)))) { return i; }Registered: Fri Dec 26 12:43:10 UTC 2025 - Last Modified: Thu Aug 07 16:05:33 UTC 2025 - 27.9K bytes - Viewed (0)