Class IJCPreconditions


  • public final class IJCPreconditions
    extends java.lang.Object
    Additional preconditions used within IJC code-base. See Preconditions for Guava ones.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Iterable<?> checkNonNullValues​(java.lang.Iterable<?> c, java.lang.Object errorMessage)
      Ensures that no value in the given map is a null reference.
      static java.util.Map<?,​?> checkNonNullValues​(java.util.Map<?,​?> map, java.lang.Object errorMessage)
      Ensures that no value in the given map is a null reference.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • checkNonNullValues

        public static java.util.Map<?,​?> checkNonNullValues​(java.util.Map<?,​?> map,
                                                                  java.lang.Object errorMessage)
                                                           throws java.lang.NullPointerException
        Ensures that no value in the given map is a null reference.
        Parameters:
        map - map whose values are to be validated
        errorMessage - the exception message to use if the check fails; will be converted to a string using String.valueOf(Object)
        Returns:
        the validated map
        Throws:
        java.lang.NullPointerException - if any value in the map is a null reference
      • checkNonNullValues

        public static java.lang.Iterable<?> checkNonNullValues​(java.lang.Iterable<?> c,
                                                               java.lang.Object errorMessage)
                                                        throws java.lang.NullPointerException
        Ensures that no value in the given map is a null reference.
        Parameters:
        c - collection to be checked
        errorMessage - the exception message to use if the check fails; will be converted to a string using String.valueOf(Object)
        Returns:
        the validated collection
        Throws:
        java.lang.NullPointerException - if any value in the collection is a null reference