Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 66 for Optional (0.17 sec)

  1. guava/src/com/google/common/base/Optional.java

     */
    @DoNotMock("Use Optional.of(value) or Optional.absent()")
    @GwtCompatible(serializable = true)
    @ElementTypesAreNonnullByDefault
    public abstract class Optional<T> implements Serializable {
      /**
       * Returns an {@code Optional} instance with no contained reference.
       *
       * <p><b>Comparison to {@code java.util.Optional}:</b> this method is equivalent to Java 8's
       * {@code Optional.empty}.
       */
      public static <T> Optional<T> absent() {
    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)
  2. android/guava/src/com/google/common/base/Optional.java

     */
    @DoNotMock("Use Optional.of(value) or Optional.absent()")
    @GwtCompatible(serializable = true)
    @ElementTypesAreNonnullByDefault
    public abstract class Optional<T> implements Serializable {
      /**
       * Returns an {@code Optional} instance with no contained reference.
       *
       * <p><b>Comparison to {@code java.util.Optional}:</b> this method is equivalent to Java 8's
       * {@code Optional.empty}.
       */
      public static <T> Optional<T> absent() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 13K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/base/OptionalTest.java

        assertThat(Optional.presentInstances(optionals)).isEmpty();
      }
    
      public void testPresentInstances_somePresent() {
        List<Optional<String>> optionals =
            ImmutableList.of(Optional.of("a"), Optional.<String>absent(), Optional.of("c"));
        assertThat(Optional.presentInstances(optionals)).containsExactly("a", "c").inOrder();
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Feb 21 18:32:41 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/base/OptionalTest.java

        assertThat(Optional.presentInstances(optionals)).isEmpty();
      }
    
      public void testPresentInstances_somePresent() {
        List<Optional<String>> optionals =
            ImmutableList.of(Optional.of("a"), Optional.<String>absent(), Optional.of("c"));
        assertThat(Optional.presentInstances(optionals)).containsExactly("a", "c").inOrder();
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Feb 21 18:32:41 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  5. guava-testlib/test/com/google/common/testing/ArbitraryInstancesTest.java

        assertNotNull(ArbitraryInstances.get(Object.class));
        assertEquals(0, ArbitraryInstances.get(Number.class));
        assertEquals(Charsets.UTF_8, ArbitraryInstances.get(Charset.class));
        assertEquals(Optional.empty(), ArbitraryInstances.get(Optional.class));
        assertEquals(OptionalInt.empty(), ArbitraryInstances.get(OptionalInt.class));
        assertEquals(OptionalLong.empty(), ArbitraryInstances.get(OptionalLong.class));
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.1K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/io/ByteSource.java

        }
    
        @Override
        public Optional<Long> sizeIfKnown() {
          Optional<Long> optionalUnslicedSize = ByteSource.this.sizeIfKnown();
          if (optionalUnslicedSize.isPresent()) {
            long unslicedSize = optionalUnslicedSize.get();
            long off = Math.min(offset, unslicedSize);
            return Optional.of(Math.min(length, unslicedSize - off));
          }
          return Optional.absent();
        }
    
        @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 26.2K bytes
    - Viewed (0)
  7. guava-testlib/src/com/google/common/collect/testing/MapInterfaceTest.java

        if (allowsNullKeys) {
          boolean unused = map.containsKey(null);
        } else {
          try {
            boolean unused2 = map.containsKey(null);
          } catch (NullPointerException optional) {
          }
        }
        assertInvariants(map);
      }
    
      public void testContainsValue() {
        Map<K, V> map;
        V unmappedValue;
        try {
          map = makePopulatedMap();
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 21 16:49:06 GMT 2024
    - 45.9K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/io/CharSource.java

        }
    
        @Override
        public Optional<Long> lengthIfKnown() {
          long result = 0L;
          for (CharSource source : sources) {
            Optional<Long> lengthIfKnown = source.lengthIfKnown();
            if (!lengthIfKnown.isPresent()) {
              return Optional.absent();
            }
            result += lengthIfKnown.get();
          }
          return Optional.of(result);
        }
    
        @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 22.4K bytes
    - Viewed (0)
  9. android/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java

      }
    
      // common.base
      @Empty
      <T> com.google.common.base.Optional<T> generateGoogleOptional() {
        return com.google.common.base.Optional.absent();
      }
    
      @Generates
      <T> com.google.common.base.Optional<T> generateGoogleOptional(T value) {
        return com.google.common.base.Optional.of(value);
      }
    
      @Generates
      Joiner generateJoiner() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 17 16:33:44 GMT 2024
    - 28K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/base/Ascii.java

       *
       * @since 8.0
       */
      public static final byte ESC = 27;
    
      /**
       * File Separator: These four information separators may be used within data in optional fashion,
       * except that their hierarchical relationship shall be: FS is the most inclusive, then GS, then
       * RS, and US is least inclusive. (The content and length of a File, Group, Record, or Unit are
       * not specified.)
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Jul 19 15:43:07 GMT 2021
    - 21.6K bytes
    - Viewed (0)
Back to top