Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for isPresent (2.76 sec)

  1. guava-tests/test/com/google/common/base/OptionalTest.java

      }
    
      public void testIsPresent_no() {
        assertFalse(Optional.absent().isPresent());
      }
    
      @SuppressWarnings("OptionalOfRedundantMethod") // Unit tests for Optional
      public void testIsPresent_yes() {
        assertTrue(Optional.of("training").isPresent());
      }
    
      public void testGet_absent() {
        Optional<String> optional = Optional.absent();
        try {
          optional.get();
    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)
  2. guava/src/com/google/common/base/Optional.java

      Optional() {}
    
      /**
       * Returns {@code true} if this holder contains a (non-null) instance.
       *
       * <p><b>Comparison to {@code java.util.Optional}:</b> no differences.
       */
      public abstract boolean isPresent();
    
      /**
       * Returns the contained instance, which must be present. If the instance might be absent, use
       * {@link #or(Object)} or {@link #orNull} instead.
       *
    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)
  3. android/guava-tests/test/com/google/common/base/OptionalTest.java

      }
    
      public void testIsPresent_no() {
        assertFalse(Optional.absent().isPresent());
      }
    
      @SuppressWarnings("OptionalOfRedundantMethod") // Unit tests for Optional
      public void testIsPresent_yes() {
        assertTrue(Optional.of("training").isPresent());
      }
    
      public void testGet_absent() {
        Optional<String> optional = Optional.absent();
        try {
          optional.get();
    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)
  4. android/guava/src/com/google/common/base/Optional.java

      Optional() {}
    
      /**
       * Returns {@code true} if this holder contains a (non-null) instance.
       *
       * <p><b>Comparison to {@code java.util.Optional}:</b> no differences.
       */
      public abstract boolean isPresent();
    
      /**
       * Returns the contained instance, which must be present. If the instance might be absent, use
       * {@link #or(Object)} or {@link #orNull} instead.
       *
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 13K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/collect/WriteReplaceOverridesTest.java

                              && (m.getModifiers() & (PUBLIC | PROTECTED | PRIVATE)) == 0)
                  .transform(Method::getDeclaringClass);
          if (!supersWithPackagePrivateWriteReplace.isPresent()) {
            continue;
          }
          assertWithMessage(
                  "To help optimizers, any class that inherits a package-private writeReplace() method"
                      + " should override that method.\n"
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Nov 30 21:54:06 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/collect/WriteReplaceOverridesTest.java

                              && (m.getModifiers() & (PUBLIC | PROTECTED | PRIVATE)) == 0)
                  .transform(Method::getDeclaringClass);
          if (!supersWithPackagePrivateWriteReplace.isPresent()) {
            continue;
          }
          assertWithMessage(
                  "To help optimizers, any class that inherits a package-private writeReplace() method"
                      + " should override that method.\n"
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Nov 30 21:54:06 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/net/InternetDomainName.java

       */
      private static boolean matchesType(
          Optional<PublicSuffixType> desiredType, Optional<PublicSuffixType> actualType) {
        return desiredType.isPresent() ? desiredType.equals(actualType) : actualType.isPresent();
      }
    
      /** Returns the domain name, normalized to all lower case. */
      @Override
      public String toString() {
        return name;
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Feb 05 20:47:23 GMT 2024
    - 28K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/collect/IteratorsTest.java

        assertEquals("woot", Iterators.tryFind(iterator, Predicates.alwaysFalse()).or("woot"));
        assertFalse(iterator.hasNext());
      }
    
      public void testTryFind_alwaysFalse_isPresent() {
        Iterable<String> list = Lists.newArrayList("cool", "pants");
        Iterator<String> iterator = list.iterator();
        assertThat(Iterators.tryFind(iterator, Predicates.alwaysFalse())).isAbsent();
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Mar 07 18:34:03 GMT 2024
    - 55.7K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/Iterables.java

       * iterator whether it has any elements <i>remaining</i> (which one does using {@link
       * Iterator#hasNext}).
       *
       * <p><b>{@code Stream} equivalent:</b> {@code !stream.findAny().isPresent()}
       *
       * @return {@code true} if the iterable contains no elements
       */
      public static boolean isEmpty(Iterable<?> iterable) {
        if (iterable instanceof Collection) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 24 19:38:27 GMT 2024
    - 42.8K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/collect/IteratorsTest.java

        assertEquals("woot", Iterators.tryFind(iterator, Predicates.alwaysFalse()).or("woot"));
        assertFalse(iterator.hasNext());
      }
    
      public void testTryFind_alwaysFalse_isPresent() {
        Iterable<String> list = Lists.newArrayList("cool", "pants");
        Iterator<String> iterator = list.iterator();
        assertThat(Iterators.tryFind(iterator, Predicates.alwaysFalse())).isAbsent();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Apr 30 18:43:01 GMT 2024
    - 56.5K bytes
    - Viewed (0)
Back to top