Class Preconditions

java.lang.Object
ai.nextbillion.maps.internal.ratelimiter.Preconditions

public final class Preconditions
extends java.lang.Object
Static convenience methods that help a method or constructor check whether it was invoked correctly (that is, whether its preconditions were met).

This is a minimal port of Google Guava's com.google.common.base.Preconditions necessary to implement the ratelimiter classes.

  • Method Summary

    Modifier and Type Method Description
    static void checkArgument​(boolean expression, java.lang.String errorMessageTemplate, java.lang.Object... errorMessageArgs)  
    static <T> T checkNotNull​(T reference)  
    static <T> T checkNotNull​(T reference, java.lang.Object errorMessage)  
    static void checkState​(boolean expression, java.lang.Object errorMessage)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • checkArgument

      public static void checkArgument​(boolean expression, java.lang.String errorMessageTemplate, java.lang.Object... errorMessageArgs)
    • checkNotNull

      public static <T> T checkNotNull​(T reference)
    • checkNotNull

      public static <T> T checkNotNull​(T reference, java.lang.Object errorMessage)
    • checkState

      public static void checkState​(boolean expression, java.lang.Object errorMessage)