- Sort Score
- Num 10 results
- Language All
Results 1 - 3 of 3 for fromNullable (0.05 seconds)
-
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) {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Wed Jun 04 13:03:16 GMT 2025 - 15.4K bytes - Click Count (0) -
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) {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Wed Jun 04 13:03:16 GMT 2025 - 15.1K bytes - Click Count (0) -
android/guava-tests/test/com/google/common/base/OptionalTest.java
} public void testFromNullable() { Optional<String> optionalName = Optional.fromNullable("bob"); assertThat(optionalName.get()).isEqualTo("bob"); } public void testFromNullable_null() { // not promised by spec, but easier to test assertThat(Optional.fromNullable(null)).isSameInstanceAs(Optional.absent()); } public void testIsPresent_no() {
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Mar 16 15:59:55 GMT 2026 - 10.6K bytes - Click Count (0)