de.danielbechler.util
Class Assert

java.lang.Object
  extended by de.danielbechler.util.Assert

public class Assert
extends Object

Author:
Daniel Bechler

Method Summary
static void equalTypesOrNull(Object... objects)
           
static void hasText(String value, String name)
          Ensures that the given value contains characters.
static void notEmpty(Collection<?> collection, String name)
           
static void notEmpty(String text, String name)
          Same as hasText(String, String).
static void notNull(Object object, String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equalTypesOrNull

public static void equalTypesOrNull(Object... objects)

notNull

public static void notNull(Object object,
                           String name)

notEmpty

public static void notEmpty(Collection<?> collection,
                            String name)

notEmpty

public static void notEmpty(String text,
                            String name)
                     throws IllegalArgumentException
Same as hasText(String, String).

Throws:
IllegalArgumentException
See Also:
hasText(String, String)

hasText

public static void hasText(String value,
                           String name)
                    throws IllegalArgumentException
Ensures that the given value contains characters.

Parameters:
value - The value to check.
name - The name of the variable (used for the exception message).
Throws:
IllegalArgumentException - If the given value is null or doesn't contain any non-whitespace characters.


Copyright © 2012. All Rights Reserved.