All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mapbox.core.internal.Preconditions Maven / Gradle / Ivy

There is a newer version: 5.9.0-alpha.1
Show newest version
package com.mapbox.core.internal;

import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;

import androidx.annotation.RestrictTo;

/**
 * Contains simple precondition checks.
 *
 * @since 3.0.0
 */
@RestrictTo(LIBRARY_GROUP)
public final class Preconditions {

  /**
   * Checks if the passed in value is not Null. Throws a NPE if the value is null.
   *
   * @param value The object to be checked fo null
   * @param message The message to be associated with NPE, if value is null
   * @since 3.0.0
   */
  public static void checkNotNull(Object value, String message) {
    if (value == null) {
      throw new NullPointerException(message);
    }
  }

  private Preconditions() {
    throw new AssertionError("No instances.");
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy