- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for or_else (2.2 sec)
-
android/guava/src/com/google/common/base/Optional.java
* Number value = first.or(0.5); // fine * }</pre> * * <p><b>Comparison to {@code java.util.Optional}:</b> this method is similar to Java 8's {@code * Optional.orElse}, but will not accept {@code null} as a {@code defaultValue} ({@link #orNull} * must be used instead). As a result, the value returned by this method is guaranteed non-null,
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Mon Apr 01 16:15:01 UTC 2024 - 13K bytes - Viewed (0) -
guava/src/com/google/common/collect/Iterables.java
* iterable is empty. * * <p><b>Java 8+ users:</b> the {@code Stream} equivalent to this method is {@code * stream.collect(MoreCollectors.toOptional()).orElse(defaultValue)}. * * @throws IllegalArgumentException if the iterator contains multiple elements */ @ParametricNullness public static <T extends @Nullable Object> T getOnlyElement(
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Apr 24 19:38:27 UTC 2024 - 42.5K bytes - Viewed (0) -
guava/src/com/google/common/base/Optional.java
* * @since 21.0 */ @CheckForNull public static <T> Optional<T> fromJavaUtil(@CheckForNull java.util.Optional<T> javaUtilOptional) { return (javaUtilOptional == null) ? null : fromNullable(javaUtilOptional.orElse(null)); } /** * Returns the equivalent {@code java.util.Optional} value to the given {@code * com.google.common.base.Optional}, or {@code null} if the argument is null. *
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Mon Apr 01 16:15:01 UTC 2024 - 14.6K bytes - Viewed (0) -
guava/src/com/google/common/collect/Comparators.java
*/ public static <T> Comparator<Optional<T>> emptiesFirst(Comparator<? super T> valueComparator) { checkNotNull(valueComparator); return Comparator.<Optional<T>, @Nullable T>comparing( o -> o.orElse(null), Comparator.nullsFirst(valueComparator)); } /** * Returns a comparator of {@link Optional} values which treats {@link Optional#empty} as greater
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Thu Apr 11 08:42:51 UTC 2024 - 10.7K bytes - Viewed (0) -
android/guava/src/com/google/common/collect/Iterables.java
* iterable is empty. * * <p><b>Java 8+ users:</b> the {@code Stream} equivalent to this method is {@code * stream.collect(MoreCollectors.toOptional()).orElse(defaultValue)}. * * @throws IllegalArgumentException if the iterator contains multiple elements */ @ParametricNullness public static <T extends @Nullable Object> T getOnlyElement(
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Wed Apr 24 19:38:27 UTC 2024 - 42.8K bytes - Viewed (0) -
android/guava/src/com/google/common/io/TempFileCreator.java
Method infoMethod = processHandleClass.getMethod("info"); Method userMethod = processHandleInfoClass.getMethod("user"); Method orElseMethod = optionalClass.getMethod("orElse", Object.class); Object current = currentMethod.invoke(null); Object info = infoMethod.invoke(current); Object user = userMethod.invoke(info);
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Fri Oct 06 17:11:11 UTC 2023 - 12.5K bytes - Viewed (0) -
guava/src/com/google/common/collect/Streams.java
// findLast(Stream) does some allocation, so we might as well box some more java.util.Optional<Integer> boxedLast = findLast(stream.boxed()); return boxedLast.map(OptionalInt::of).orElse(OptionalInt.empty()); } /** * Returns the last element of the specified stream, or {@link OptionalLong#empty} if the stream * is empty. *
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Thu Feb 22 21:19:52 UTC 2024 - 36.5K bytes - Viewed (0) -
guava/src/com/google/common/io/TempFileCreator.java
Method infoMethod = processHandleClass.getMethod("info"); Method userMethod = processHandleInfoClass.getMethod("user"); Method orElseMethod = optionalClass.getMethod("orElse", Object.class); Object current = currentMethod.invoke(null); Object info = infoMethod.invoke(current); Object user = userMethod.invoke(info);
Registered: Wed Jun 12 16:38:11 UTC 2024 - Last Modified: Fri Oct 06 17:11:11 UTC 2023 - 12.5K bytes - Viewed (0)