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
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top