Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for toStringFunction (0.07 sec)

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

        checkCanReserializeSingleton(Functions.identity());
      }
    
      public void testToStringFunction_apply() {
        assertEquals("3", Functions.toStringFunction().apply(3));
        assertEquals("hiya", Functions.toStringFunction().apply("hiya"));
        assertEquals(
            "I'm a string",
            Functions.toStringFunction()
                .apply(
                    new Object() {
                      @Override
                      public String toString() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 15.9K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/collect/MapsTransformValuesUnmodifiableIteratorTest.java

      }
    
      @Override
      protected Map<String, String> makePopulatedMap() {
        Map<String, Integer> underlying = new HashMap<>();
        underlying.put("a", 1);
        underlying.put("b", 2);
        underlying.put("c", 3);
        return transformValues(
            new UnmodifiableIteratorMap<String, Integer>(underlying), Functions.toStringFunction());
      }
    
      @Override
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 17:27:14 UTC 2025
    - 12.3K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/base/FunctionsTest.java

        checkCanReserializeSingleton(Functions.identity());
      }
    
      public void testToStringFunction_apply() {
        assertEquals("3", Functions.toStringFunction().apply(3));
        assertEquals("hiya", Functions.toStringFunction().apply("hiya"));
        assertEquals(
            "I'm a string",
            Functions.toStringFunction()
                .apply(
                    new Object() {
                      @Override
                      public String toString() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 15.9K bytes
    - Viewed (0)
  4. guava/src/com/google/common/base/Functions.java

       * the JDK {@link java.util.function.Function} class, see {@link Function}.
       */
      public static Function<Object, String> toStringFunction() {
        return ToStringFunction.INSTANCE;
      }
    
      // enum singleton pattern
      private enum ToStringFunction implements Function<Object, String> {
        INSTANCE;
    
        @Override
        public String apply(Object o) {
          checkNotNull(o); // eager for GWT.
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Aug 06 17:32:30 UTC 2025
    - 15.4K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/collect/TableCollectionTest.java

                        Table<String, Integer, Character> table = HashBasedTable.create();
                        populateForRowKeySet(table, elements);
                        return transformValues(table, Functions.toStringFunction()).column(1).keySet();
                      }
                    })
                .named("TransformValues.column.keySet")
                .withFeatures(COLLECTION_FEATURES_REMOVE)
                .createTestSuite());
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 35.5K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/base/Equivalence.java

       * relation. That is, invoking {@link Function#apply} multiple times for a given value must return
       * equivalent results. For example, {@code
       * Equivalence.identity().onResultOf(Functions.toStringFunction())} is broken because it's not
       * guaranteed that {@link Object#toString}) always returns the same string instance.
       *
       * @since 10.0
       */
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Jul 10 01:47:55 UTC 2025
    - 14.5K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/FluentIterable.java

       * Color red = new Color("red", 255, 0, 0);
       * ...
       * FluentIterable<Color> allColors = FluentIterable.from(ImmutableSet.of(red, green, blue));
       *
       * Map<String, Color> colorForName = allColors.uniqueIndex(toStringFunction());
       * assertThat(colorForName).containsEntry("red", red);
       * }
       *
       * <p>If your index may associate multiple values with each key, use {@link #index(Function)
       * index}.
       *
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 35.3K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/FluentIterable.java

       * Color red = new Color("red", 255, 0, 0);
       * ...
       * FluentIterable<Color> allColors = FluentIterable.from(ImmutableSet.of(red, green, blue));
       *
       * Map<String, Color> colorForName = allColors.uniqueIndex(toStringFunction());
       * assertThat(colorForName).containsEntry("red", red);
       * }
       *
       * <p>If your index may associate multiple values with each key, use {@link #index(Function)
       * index}.
       *
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 34.8K bytes
    - Viewed (0)
Back to top