< prev index next >

jdk/src/jdk.jline/share/classes/jdk/internal/jline/internal/Preconditions.java

Print this page


   1 /*
   2  * Copyright (c) 2002-2012, the original author or authors.
   3  *
   4  * This software is distributable under the BSD license. See the terms of the
   5  * BSD license in the documentation provided with this software.
   6  *
   7  * http://www.opensource.org/licenses/bsd-license.php
   8  */
   9 package jline.internal;
  10 
  11 // Some bits lifted from Guava's ( http://code.google.com/p/guava-libraries/ ) Preconditions.
  12 
  13 /**
  14  * Preconditions.
  15  *
  16  * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
  17  * @since 2.7
  18  */
  19 public class Preconditions
  20 {
  21     public static <T> T checkNotNull(final T reference) {
  22         if (reference == null) {
  23             throw new NullPointerException();
  24         }
  25         return reference;
  26     }
  27 }
   1 /*
   2  * Copyright (c) 2002-2012, the original author or authors.
   3  *
   4  * This software is distributable under the BSD license. See the terms of the
   5  * BSD license in the documentation provided with this software.
   6  *
   7  * http://www.opensource.org/licenses/bsd-license.php
   8  */
   9 package jdk.internal.jline.internal;
  10 
  11 // Some bits lifted from Guava's ( http://code.google.com/p/guava-libraries/ ) Preconditions.
  12 
  13 /**
  14  * Preconditions.
  15  *
  16  * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
  17  * @since 2.7
  18  */
  19 public class Preconditions
  20 {
  21     public static <T> T checkNotNull(final T reference) {
  22         if (reference == null) {
  23             throw new NullPointerException();
  24         }
  25         return reference;
  26     }
  27 }
< prev index next >