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
mongo-express - Web-based MongoDB admin interface, written with No... 2017-05-17
XCL-Charts - Android charting libraries (XCL-Charts is a free c... 2017-05-17
scrollMonitor - A simple and fast API to monitor elements as you s... 2017-05-16
XCDYouTubeKit - YouTube video player for iOS, tvOS and macOS 2017-05-16
rails-erd - Generate Entity-Relationship Diagrams for Rails ap... 2017-05-16
np - A better `npm publish` 2017-05-16
android - Smartisan open source code for full build.(repo ma... 2017-05-16
word_cloud - A little word cloud generator in Pytho 2017-05-16
mobileplayer-ios - 2017-05-16
Destroy-Windows-10-Spying - Destroy Windows Spying tool ... 2017-05-15

 Back to top