Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for ofInstance (0.11 sec)

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

        new EqualsTester()
            .addEqualityGroup(Suppliers.ofInstance("foo"), Suppliers.ofInstance("foo"))
            .addEqualityGroup(Suppliers.ofInstance("bar"))
            .testEquals();
      }
    
      public void testCompose_equals() {
        new EqualsTester()
            .addEqualityGroup(
                Suppliers.compose(Functions.constant(1), Suppliers.ofInstance("foo")),
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 17.9K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java

      }
    
      @SuppressWarnings("ReturnValueIgnored")
      public void testMaximumWeight_withoutWeigher() {
        CacheBuilder<Object, Object> builder = CacheBuilder.from(parse("maximumWeight=9000"));
        assertThrows(
            IllegalStateException.class,
            () -> builder.build(CacheLoader.from(Suppliers.ofInstance(null))));
      }
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Dec 19 18:03:30 UTC 2024
    - 19.1K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/cache/CacheBuilderSpecTest.java

      }
    
      @SuppressWarnings("ReturnValueIgnored")
      public void testMaximumWeight_withoutWeigher() {
        CacheBuilder<Object, Object> builder = CacheBuilder.from(parse("maximumWeight=9000"));
        assertThrows(
            IllegalStateException.class,
            () -> builder.build(CacheLoader.from(Suppliers.ofInstance(null))));
      }
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Dec 19 18:03:30 UTC 2024
    - 19.1K bytes
    - Viewed (0)
  4. guava/src/com/google/common/base/Suppliers.java

       * supplier that is serializable, use {@code (Supplier<T> & Serializable) () -> instance}.
       */
      public static <T extends @Nullable Object> Supplier<T> ofInstance(
          @ParametricNullness T instance) {
        return new SupplierOfInstance<>(instance);
      }
    
      private static final class SupplierOfInstance<T extends @Nullable Object>
          implements Supplier<T>, Serializable {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 16.5K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/base/Suppliers.java

       * supplier that is serializable, use {@code (Supplier<T> & Serializable) () -> instance}.
       */
      public static <T extends @Nullable Object> Supplier<T> ofInstance(
          @ParametricNullness T instance) {
        return new SupplierOfInstance<>(instance);
      }
    
      private static final class SupplierOfInstance<T extends @Nullable Object>
          implements Supplier<T>, Serializable {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sat Aug 09 01:14:59 UTC 2025
    - 16.5K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/base/FunctionsTest.java

        new EqualsTester()
            .addEqualityGroup(function, Functions.forSupplier(supplier))
            .addEqualityGroup(Functions.forSupplier(new CountingSupplier()))
            .addEqualityGroup(Functions.forSupplier(Suppliers.ofInstance(12)))
            .addEqualityGroup(Functions.toStringFunction())
            .testEquals();
      }
    
      @J2ktIncompatible
      @GwtIncompatible // SerializableTester
      public void testForSupplierSerializable() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 15.9K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/base/FunctionsTest.java

        new EqualsTester()
            .addEqualityGroup(function, Functions.forSupplier(supplier))
            .addEqualityGroup(Functions.forSupplier(new CountingSupplier()))
            .addEqualityGroup(Functions.forSupplier(Suppliers.ofInstance(12)))
            .addEqualityGroup(Functions.toStringFunction())
            .testEquals();
      }
    
      @J2ktIncompatible
      @GwtIncompatible // SerializableTester
      public void testForSupplierSerializable() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 15.9K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java

      }
    
      public void testThreadRenaming() {
        Executor renamingExecutor =
            renamingDecorator(newDirectExecutorService(), Suppliers.ofInstance("FooBar"));
        String oldName = Thread.currentThread().getName();
        renamingExecutor.execute(
            new Runnable() {
              @Override
              public void run() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 28K bytes
    - Viewed (0)
Back to top