Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 165 for checkArgument (0.05 sec)

  1. android/guava-testlib/src/com/google/common/testing/ArbitraryInstances.java

      private static <T> void setImplementation(Class<T> type, Class<? extends T> implementation) {
        checkArgument(type != implementation, "Don't register %s to itself!", type);
        checkArgument(
            !DEFAULTS.containsKey(type), "A default value was already registered for %s", type);
        checkArgument(
            implementations.put(type, implementation) == null,
            "Implementation for %s was already registered",
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-02-19 21:24
    - 20.8K bytes
    - Viewed (0)
  2. android/guava-testlib/src/com/google/common/testing/ForwardingWrapperTester.java

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    package com.google.common.testing;
    
    import static com.google.common.base.Preconditions.checkArgument;
    import static com.google.common.base.Preconditions.checkNotNull;
    import static com.google.common.base.Throwables.throwIfUnchecked;
    import static junit.framework.Assert.assertEquals;
    import static junit.framework.Assert.fail;
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-05-13 17:27
    - 9.1K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/base/PreconditionsTest.java

    public class PreconditionsTest extends TestCase {
      public void testCheckArgument_simple_success() {
        checkArgument(true);
      }
    
      public void testCheckArgument_simple_failure() {
        assertThrows(IllegalArgumentException.class, () -> checkArgument(false));
      }
    
      public void testCheckArgument_simpleMessage_success() {
        checkArgument(true, IGNORE_ME);
      }
    
      public void testCheckArgument_simpleMessage_failure() {
    Registered: 2025-05-30 12:43
    - Last Modified: 2024-12-28 01:26
    - 19K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/cache/CacheStats.java

          long loadSuccessCount,
          long loadExceptionCount,
          long totalLoadTime,
          long evictionCount) {
        checkArgument(hitCount >= 0);
        checkArgument(missCount >= 0);
        checkArgument(loadSuccessCount >= 0);
        checkArgument(loadExceptionCount >= 0);
        checkArgument(totalLoadTime >= 0);
        checkArgument(evictionCount >= 0);
    
        this.hitCount = hitCount;
        this.missCount = missCount;
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-02-13 15:45
    - 12.6K bytes
    - Viewed (0)
  5. guava/src/com/google/common/cache/CacheStats.java

          long loadSuccessCount,
          long loadExceptionCount,
          long totalLoadTime,
          long evictionCount) {
        checkArgument(hitCount >= 0);
        checkArgument(missCount >= 0);
        checkArgument(loadSuccessCount >= 0);
        checkArgument(loadExceptionCount >= 0);
        checkArgument(totalLoadTime >= 0);
        checkArgument(evictionCount >= 0);
    
        this.hitCount = hitCount;
        this.missCount = missCount;
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-02-13 15:45
    - 12.6K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/io/CharSequenceReader.java

     * or implied. See the License for the specific language governing permissions and limitations under
     * the License.
     */
    
    package com.google.common.io;
    
    import static com.google.common.base.Preconditions.checkArgument;
    import static com.google.common.base.Preconditions.checkNotNull;
    import static com.google.common.base.Preconditions.checkPositionIndexes;
    import static java.lang.Math.min;
    import static java.util.Objects.requireNonNull;
    
    Registered: 2025-05-30 12:43
    - Last Modified: 2024-12-22 03:38
    - 4.5K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/reflect/TypeParameter.java

     * or implied. See the License for the specific language governing permissions and limitations under
     * the License.
     */
    
    package com.google.common.reflect;
    
    import static com.google.common.base.Preconditions.checkArgument;
    
    import java.lang.reflect.Type;
    import java.lang.reflect.TypeVariable;
    import org.jspecify.annotations.Nullable;
    
    /**
     * Captures a free type variable that can be used in {@link TypeToken#where}. For example:
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-03-17 20:26
    - 2.4K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/eventbus/SubscriberRegistry.java

              Class<?>[] parameterTypes = method.getParameterTypes();
              checkArgument(
                  parameterTypes.length == 1,
                  "Method %s has @Subscribe annotation but has %s parameters. "
                      + "Subscriber methods must have exactly 1 parameter.",
                  method,
                  parameterTypes.length);
    
              checkArgument(
                  !parameterTypes[0].isPrimitive(),
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-05-13 17:27
    - 10.8K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/base/Preconditions.java

      }
    
      /**
       * Ensures the truth of an expression involving one or more parameters to the calling method.
       *
       * <p>See {@link #checkArgument(boolean, String, Object...)} for details.
       *
       * @since 20.0 (varargs overload since 2.0)
       */
      public static void checkArgument(boolean expression, String errorMessageTemplate, char p1) {
        if (!expression) {
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-03-17 20:26
    - 52.8K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/FuturesGetChecked.java

      }
    
      @VisibleForTesting
      static void checkExceptionClassValidity(Class<? extends Exception> exceptionClass) {
        checkArgument(
            isCheckedException(exceptionClass),
            "Futures.getChecked exception type (%s) must not be a RuntimeException",
            exceptionClass);
        checkArgument(
            hasConstructorUsableByGetChecked(exceptionClass),
    Registered: 2025-05-30 12:43
    - Last Modified: 2024-12-22 03:38
    - 10.2K bytes
    - Viewed (0)
Back to top