Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for defaultValue (0.51 sec)

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

        assertEquals(false, Defaults.defaultValue(boolean.class).booleanValue());
        assertEquals('\0', Defaults.defaultValue(char.class).charValue());
        assertEquals(0, Defaults.defaultValue(byte.class).byteValue());
        assertEquals(0, Defaults.defaultValue(short.class).shortValue());
        assertEquals(0, Defaults.defaultValue(int.class).intValue());
        assertEquals(0, Defaults.defaultValue(long.class).longValue());
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Oct 10 08:40:05 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/Iterables.java

       * Returns the first element in {@code iterable} that satisfies the given predicate, or {@code
       * defaultValue} if none found. Note that this can usually be handled more naturally using {@code
       * tryFind(iterable, predicate).or(defaultValue)}.
       *
       * <p><b>{@code Stream} equivalent:</b> {@code
       * stream.filter(predicate).findFirst().orElse(defaultValue)}
       *
       * @since 7.0
       */
      // The signature we really want here is...
      //
    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)
  3. guava/src/com/google/common/base/Functions.java

       * @return function that returns {@code map.get(a)} when {@code a} is a key, or {@code
       *     defaultValue} otherwise
       */
      public static <K extends @Nullable Object, V extends @Nullable Object> Function<K, V> forMap(
          Map<K, ? extends V> map, @ParametricNullness V defaultValue) {
        return new ForMapWithDefault<>(map, defaultValue);
      }
    
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  4. android/guava-testlib/src/com/google/common/testing/ClassSanityTester.java

        @SuppressWarnings("unchecked") // Assume all default values are generics safe.
        T defaultValue = (T) defaultValues.getInstance(rawType);
        if (defaultValue != null) {
          return defaultValue;
        }
        @SuppressWarnings("unchecked") // ArbitraryInstances always returns generics-safe dummies.
        T value = (T) ArbitraryInstances.get(rawType);
        if (value != null) {
          return value;
        }
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 08 17:31:55 GMT 2024
    - 33K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/graph/ValueGraph.java

       * otherwise, returns {@code defaultValue}.
       *
       * <p>In an undirected graph, this is equal to {@code edgeValueOrDefault(nodeV, nodeU,
       * defaultValue)}.
       *
       * @throws IllegalArgumentException if {@code nodeU} or {@code nodeV} is not an element of this
       *     graph
       */
      @CheckForNull
      V edgeValueOrDefault(N nodeU, N nodeV, @CheckForNull V defaultValue);
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Jan 22 17:29:38 GMT 2024
    - 15K bytes
    - Viewed (0)
  6. android/guava-testlib/src/com/google/common/testing/FreshValueGenerator.java

        throw new UnsupportedOperationException();
      }
    
      private <T> T pickInstance(T[] instances, T defaultValue) {
        return pickInstance(Arrays.asList(instances), defaultValue);
      }
    
      private <T> T pickInstance(Collection<T> instances, T defaultValue) {
        if (instances.isEmpty()) {
          return defaultValue;
        }
        // generateInt() is 1-based.
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Apr 17 16:33:44 GMT 2024
    - 28K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/base/Functions.java

       * @return function that returns {@code map.get(a)} when {@code a} is a key, or {@code
       *     defaultValue} otherwise
       */
      public static <K extends @Nullable Object, V extends @Nullable Object> Function<K, V> forMap(
          Map<K, ? extends V> map, @ParametricNullness V defaultValue) {
        return new ForMapWithDefault<>(map, defaultValue);
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  8. guava-testlib/src/com/google/common/testing/FreshValueGenerator.java

        throw new UnsupportedOperationException();
      }
    
      private <T> T pickInstance(T[] instances, T defaultValue) {
        return pickInstance(Arrays.asList(instances), defaultValue);
      }
    
      private <T> T pickInstance(Collection<T> instances, T defaultValue) {
        if (instances.isEmpty()) {
          return defaultValue;
        }
        // generateInt() is 1-based.
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 17 16:33:44 GMT 2024
    - 28.6K bytes
    - Viewed (0)
  9. guava/src/com/google/common/base/Optional.java

      /**
       * Returns the contained instance if it is present; {@code defaultValue} otherwise. If no default
       * value should be required because the instance is known to be present, use {@link #get()}
       * instead. For a default value of {@code null}, use {@link #orNull}.
       *
       * <p>Note about generics: The signature {@code public T or(T defaultValue)} is overly
    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)
  10. android/guava/src/com/google/common/graph/StandardValueGraph.java

        return edgeValueOrDefaultInternal(checkNotNull(nodeU), checkNotNull(nodeV), defaultValue);
      }
    
      @Override
      @CheckForNull
      public V edgeValueOrDefault(EndpointPair<N> endpoints, @CheckForNull V defaultValue) {
        validateEndpoints(endpoints);
        return edgeValueOrDefaultInternal(endpoints.nodeU(), endpoints.nodeV(), defaultValue);
      }
    
      @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Jan 22 17:29:38 GMT 2024
    - 6.1K bytes
    - Viewed (0)
Back to top