Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 38 for defaultValue (1.35 sec)

  1. guava/src/com/google/common/base/Present.java

      }
    
      @Override
      public boolean isPresent() {
        return true;
      }
    
      @Override
      public T get() {
        return reference;
      }
    
      @Override
      public T or(T defaultValue) {
        checkNotNull(defaultValue, "use Optional.orNull() instead of Optional.or(null)");
        return reference;
      }
    
      @Override
      public Optional<T> or(Optional<? extends T> secondChoice) {
        checkNotNull(secondChoice);
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri Oct 01 17:18:04 UTC 2021
    - 2.4K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/base/Absent.java

        return false;
      }
    
      @Override
      public T get() {
        throw new IllegalStateException("Optional.get() cannot be called on an absent value");
      }
    
      @Override
      public T or(T defaultValue) {
        return checkNotNull(defaultValue, "use Optional.orNull() instead of Optional.or(null)");
      }
    
      @SuppressWarnings("unchecked") // safe covariant cast
      @Override
      public Optional<T> or(Optional<? extends T> secondChoice) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon May 17 14:07:47 UTC 2021
    - 2.5K bytes
    - Viewed (0)
  3. guava/src/com/google/common/graph/Graphs.java

        public V edgeValueOrDefault(N nodeU, N nodeV, @CheckForNull V defaultValue) {
          return delegate().edgeValueOrDefault(nodeV, nodeU, defaultValue); // transpose
        }
    
        @Override
        @CheckForNull
        public V edgeValueOrDefault(EndpointPair<N> endpoints, @CheckForNull V defaultValue) {
          return delegate().edgeValueOrDefault(transpose(endpoints), defaultValue);
        }
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 01 16:15:01 UTC 2024
    - 21.7K bytes
    - Viewed (0)
  4. 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);
    
      /**
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Jan 22 17:29:38 UTC 2024
    - 16K bytes
    - Viewed (0)
  5. 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;
        }
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Jun 11 16:13:05 UTC 2024
    - 32.7K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/base/Defaults.java

       * false} for {@code boolean} and {@code '\0'} for {@code char}. For non-primitive types and
       * {@code void}, {@code null} is returned.
       */
      @SuppressWarnings("unchecked")
      @CheckForNull
      public static <T> T defaultValue(Class<T> type) {
        checkNotNull(type);
        if (type.isPrimitive()) {
          if (type == boolean.class) {
            return (T) Boolean.FALSE;
          } else if (type == char.class) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 23 15:09:35 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  7. 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.
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Apr 17 16:33:44 UTC 2024
    - 28.6K bytes
    - Viewed (0)
  8. 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.
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Apr 17 16:33:44 UTC 2024
    - 28K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/collect/ImmutableMap.java

        /*
         * Even though it's weird to pass a defaultValue that is null, some callers do so. Those who
         * pass a literal "null" should probably just use `get`, but I would expect other callers to
         * pass an expression that *might* be null. This could happen with:
         *
         * - a `getFooOrDefault(@CheckForNull Foo defaultValue)` method that returns
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Sun Jun 02 13:36:19 UTC 2024
    - 41.6K bytes
    - Viewed (0)
  10. android/guava-testlib/src/com/google/common/testing/NullPointerTester.java

        // We assume that all defaults are generics-safe, even if they aren't,
        // we take the risk.
        @SuppressWarnings("unchecked")
        T defaultValue = (T) defaults.getInstance(type.getRawType());
        if (defaultValue != null) {
          return defaultValue;
        }
        @SuppressWarnings("unchecked") // All arbitrary instances are generics-safe
        T arbitrary = (T) ArbitraryInstances.get(type.getRawType());
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Jun 11 16:13:05 UTC 2024
    - 22.6K bytes
    - Viewed (0)
Back to top