- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for fromNullable (0.3 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 Nov 01 12:43:10 UTC 2024 - Last Modified: Tue Sep 17 18:14:12 UTC 2024 - 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 Nov 01 12:43:10 UTC 2024 - Last Modified: Thu Oct 31 14:20:11 UTC 2024 - 15.4K bytes - Viewed (0)