BVB Source Codes

Luban Show Preconditions.java Source code

Return Download Luban: download Preconditions.java Source code - Download Luban Source code - Type:.java
  1. package top.zibin.luban;
  2.  
  3. import android.support.annotation.Nullable;
  4.  
  5. final class Preconditions {
  6.  
  7.     /**
  8.      * Ensures that an object reference passed as a parameter to the calling method is not null.
  9.      *
  10.      * @param reference an object reference
  11.      * @return the non-null reference that was validated
  12.      * @throws NullPointerException if {@code reference} is null
  13.      */
  14.     static <T> T checkNotNull(T reference) {
  15.         if (reference == null) {
  16.             throw new NullPointerException();
  17.         }
  18.         return reference;
  19.     }
  20.  
  21.     /**
  22.      * Ensures that an object reference passed as a parameter to the calling method is not null.
  23.      *
  24.      * @param reference    an object reference
  25.      * @param errorMessage the exception message to use if the check fails; will be converted to a
  26.      *                     string using {@link String#valueOf(Object)}
  27.      * @return the non-null reference that was validated
  28.      * @throws NullPointerException if {@code reference} is null
  29.      */
  30.     static <T> T checkNotNull(T reference, @Nullable Object errorMessage) {
  31.         if (reference == null) {
  32.             throw new NullPointerException(String.valueOf(errorMessage));
  33.         }
  34.         return reference;
  35.     }
  36. }
  37.  
downloadPreconditions.java Source code - Download Luban Source code
Related Source Codes/Software:
vue-router - The official router for Vue.js. ... 2017-01-11
socketcluster - Highly scalable realtime framework ... 2017-01-11
forum - Blue light (the Lantern) the official BBS 2017-01-11
tensorflow-zh - Google new open source ai system TensorFlow Chines... 2017-01-11
react-native-elements - React Native Elements UI Toolkit 2017-01-11
show-me-the-code - Python's book and a small program every day 2017-01-11
places - 2017-01-11
buck - A fast build system that encourages the creation o... 2017-01-11
react-native-web - React Native for We 2017-01-11
awesome-python-cn - Python resources of Chinese version, include: Web ... 2017-01-11
KeychainAccess - Simple Swift wrapper for Keychain that works on iO... 2017-02-20
emojicon - A library to show emoji in TextView, EditText (lik... 2017-02-20
postgres - Mirror of the official PostgreSQL GIT repository. ... 2017-02-20
shuttle - A simple SSH shortcut menu for macOS ... 2017-02-20
sticky-headers-recyclerview - [UNMAINTAINED] Sticky Headers decorator for Androi... 2017-02-20
octokit.rb - Ruby toolkit for the GitHub API ... 2017-02-20
ricochet - Anonymous peer-to-peer instant messaging ... 2017-02-20
mobile-chrome-apps - Chrome apps on Android and iOS 2017-02-20
pycrumbs - Bits and bytes of Python from the Internet 2017-02-20
drupal - Verbatim mirror of the git.drupal.org repository f... 2017-02-20

 Back to top