Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for isPresent (0.22 sec)

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

        assertThat(Enums.getIfPresent(TestEnum.class, "POODLE")).hasValue(TestEnum.POODLE);
    
        assertThat(Enums.getIfPresent(TestEnum.class, "CHEETO")).isPresent();
        assertThat(Enums.getIfPresent(TestEnum.class, "HONDA")).isPresent();
        assertThat(Enums.getIfPresent(TestEnum.class, "POODLE")).isPresent();
    
        assertThat(Enums.getIfPresent(TestEnum.class, "CHEETO")).hasValue(TestEnum.CHEETO);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Oct 03 20:10:02 GMT 2023
    - 8.8K bytes
    - Viewed (0)
  2. guava/src/com/google/common/base/Absent.java

      @SuppressWarnings("unchecked") // implementation is "fully variant"
      static <T> Optional<T> withType() {
        return (Optional<T>) INSTANCE;
      }
    
      private Absent() {}
    
      @Override
      public boolean isPresent() {
        return false;
      }
    
      @Override
      public T get() {
        throw new IllegalStateException("Optional.get() cannot be called on an absent value");
      }
    
      @Override
      public T or(T defaultValue) {
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon May 17 14:07:47 GMT 2021
    - 2.5K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/base/Absent.java

      @SuppressWarnings("unchecked") // implementation is "fully variant"
      static <T> Optional<T> withType() {
        return (Optional<T>) INSTANCE;
      }
    
      private Absent() {}
    
      @Override
      public boolean isPresent() {
        return false;
      }
    
      @Override
      public T get() {
        throw new IllegalStateException("Optional.get() cannot be called on an absent value");
      }
    
      @Override
      public T or(T defaultValue) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon May 17 14:07:47 GMT 2021
    - 2.5K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/io/ByteSourceTester.java

        assertEquals(expected.length, source.size());
      }
    
      public void testSizeIfKnown() throws IOException {
        Optional<Long> sizeIfKnown = source.sizeIfKnown();
        if (sizeIfKnown.isPresent()) {
          assertEquals(expected.length, (long) sizeIfKnown.get());
        }
      }
    
      public void testContentEquals() throws IOException {
        assertTrue(
            source.contentEquals(
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/base/EnumsTest.java

        assertThat(Enums.getIfPresent(TestEnum.class, "POODLE")).hasValue(TestEnum.POODLE);
    
        assertThat(Enums.getIfPresent(TestEnum.class, "CHEETO")).isPresent();
        assertThat(Enums.getIfPresent(TestEnum.class, "HONDA")).isPresent();
        assertThat(Enums.getIfPresent(TestEnum.class, "POODLE")).isPresent();
    
        assertThat(Enums.getIfPresent(TestEnum.class, "CHEETO")).hasValue(TestEnum.CHEETO);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Oct 03 20:10:02 GMT 2023
    - 8.8K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/io/CharSourceTester.java

        assertEquals(expected.length(), source.length());
      }
    
      public void testLengthIfKnown() throws IOException {
        Optional<Long> lengthIfKnown = source.lengthIfKnown();
        if (lengthIfKnown.isPresent()) {
          assertEquals(expected.length(), (long) lengthIfKnown.get());
        }
      }
    
      public void testReadLines_withProcessor() throws IOException {
        List<String> list =
            source.readLines(
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 6.8K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/io/ByteSourceTester.java

        assertEquals(expected.length, source.size());
      }
    
      public void testSizeIfKnown() throws IOException {
        Optional<Long> sizeIfKnown = source.sizeIfKnown();
        if (sizeIfKnown.isPresent()) {
          assertEquals(expected.length, (long) sizeIfKnown.get());
        }
      }
    
      public void testContentEquals() throws IOException {
        assertTrue(
            source.contentEquals(
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java

          @Override
          String read(ByteSource byteSource, Charset cs) throws IOException {
            Optional<Long> size = byteSource.sizeIfKnown();
            // if we know the size and it fits in an int
            if (size.isPresent() && size.get().longValue() == size.get().intValue()) {
              // otherwise try to presize a StringBuilder
              // it is kind of lame that we need to construct a decoder to access this value.
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 5.2K bytes
    - Viewed (0)
Back to top