Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for or_else (0.17 sec)

  1. guava-tests/test/com/google/common/graph/ValueGraphTest.java

        assertThat(graph.edgeValue(1, 2).orElse(DEFAULT)).isEqualTo(DEFAULT);
        assertThat(graph.edgeValue(2, 1).orElse(DEFAULT)).isEqualTo(DEFAULT);
        assertThat(graph.edgeValueOrDefault(1, 2, null)).isNull();
        assertThat(graph.edgeValueOrDefault(2, 1, null)).isNull();
        assertThat(graph.edgeValue(1, 2).orElse(null)).isNull();
        assertThat(graph.edgeValue(2, 1).orElse(null)).isNull();
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 18:35:19 GMT 2024
    - 20K bytes
    - Viewed (0)
  2. 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(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Apr 24 19:38:27 GMT 2024
    - 42.8K bytes
    - Viewed (0)
  3. 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);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Oct 06 17:11:11 GMT 2023
    - 12.5K bytes
    - Viewed (0)
  4. 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.
       *
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 14.6K bytes
    - Viewed (0)
  5. 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
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 10.7K bytes
    - Viewed (0)
  6. 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,
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 13K bytes
    - Viewed (0)
  7. 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(
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 42.5K bytes
    - Viewed (0)
Back to top