com.twelvemonkeys.lang
Class Validate

java.lang.Object
  extended by com.twelvemonkeys.lang.Validate

public final class Validate
extends Object

Kind of like org.apache.commons.lang.Validate. Just smarter. ;-)

Uses type parameterized return values, thus making it possible to check constructor arguments before they are passed on to super or this type constructors.

Version:
$Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/lang/Validate.java#1 $
Author:
Harald Kuhr, last modified by $Author: haku $

Method Summary
static boolean isTrue(boolean pExpression, String pMessage)
           
static
<T> T
isTrue(boolean condition, T value, String message)
           
static
<T> Collection<T>
noNullElements(Collection<T> pParameter)
           
static
<T> Collection<T>
noNullElements(Collection<T> pParameter, String pParamName)
           
static
<T> T[]
noNullElements(T[] pParameter)
           
static
<T> T[]
noNullElements(T[] pParameter, String pParamName)
           
static
<K,V> Map<K,V>
noNullKeys(Map<K,V> pParameter)
           
static
<K,V> Map<K,V>
noNullKeys(Map<K,V> pParameter, String pParamName)
           
static
<K,V> Map<K,V>
noNullValues(Map<K,V> pParameter)
           
static
<K,V> Map<K,V>
noNullValues(Map<K,V> pParameter, String pParamName)
           
static
<T> Collection<T>
notEmpty(Collection<T> pParameter)
           
static
<T> Collection<T>
notEmpty(Collection<T> pParameter, String pParamName)
           
static
<K,V> Map<K,V>
notEmpty(Map<K,V> pParameter)
           
static
<K,V> Map<K,V>
notEmpty(Map<K,V> pParameter, String pParamName)
           
static
<T extends CharSequence>
T
notEmpty(T pParameter)
           
static
<T> T[]
notEmpty(T[] pParameter)
           
static
<T> T[]
notEmpty(T[] pParameter, String pParamName)
           
static
<T extends CharSequence>
T
notEmpty(T pParameter, String pParamName)
           
static
<T> T
notNull(T pParameter)
           
static
<T> T
notNull(T pParameter, String pParamName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

notNull

public static <T> T notNull(T pParameter)

notNull

public static <T> T notNull(T pParameter,
                            String pParamName)

notEmpty

public static <T extends CharSequence> T notEmpty(T pParameter)

notEmpty

public static <T extends CharSequence> T notEmpty(T pParameter,
                                                  String pParamName)

notEmpty

public static <T> T[] notEmpty(T[] pParameter)

notEmpty

public static <T> T[] notEmpty(T[] pParameter,
                               String pParamName)

notEmpty

public static <T> Collection<T> notEmpty(Collection<T> pParameter)

notEmpty

public static <T> Collection<T> notEmpty(Collection<T> pParameter,
                                         String pParamName)

notEmpty

public static <K,V> Map<K,V> notEmpty(Map<K,V> pParameter)

notEmpty

public static <K,V> Map<K,V> notEmpty(Map<K,V> pParameter,
                                      String pParamName)

noNullElements

public static <T> T[] noNullElements(T[] pParameter)

noNullElements

public static <T> T[] noNullElements(T[] pParameter,
                                     String pParamName)

noNullElements

public static <T> Collection<T> noNullElements(Collection<T> pParameter)

noNullElements

public static <T> Collection<T> noNullElements(Collection<T> pParameter,
                                               String pParamName)

noNullValues

public static <K,V> Map<K,V> noNullValues(Map<K,V> pParameter)

noNullValues

public static <K,V> Map<K,V> noNullValues(Map<K,V> pParameter,
                                          String pParamName)

noNullKeys

public static <K,V> Map<K,V> noNullKeys(Map<K,V> pParameter)

noNullKeys

public static <K,V> Map<K,V> noNullKeys(Map<K,V> pParameter,
                                        String pParamName)

isTrue

public static boolean isTrue(boolean pExpression,
                             String pMessage)

isTrue

public static <T> T isTrue(boolean condition,
                           T value,
                           String message)


Copyright © 2014. All Rights Reserved.