ShrinkWrap Resolver Aggregator 1.1.0-alpha-2

org.jboss.shrinkwrap.resolver.impl.maven.util
Class Validate

java.lang.Object
  extended by org.jboss.shrinkwrap.resolver.impl.maven.util.Validate

public final class Validate
extends Object

Validate Validation utility

Author:
Aslak Knutsen

Method Summary
static void isReadable(String path, String message)
          Checks that the specified String is not null or empty and represents a readable file, throws exception if it is empty or null and does not represent a path to a file.
static void notEmpty(Collection<?> collection, String message)
          Checks that collection is not null or empty, throws exception if it is.
static void notNull(Object obj, String message)
          Checks that object is not null, throws exception if it is.
static void notNullAndNoNullValues(Object[] objects, String message)
          Checks that the specified array is not null or contain any null values.
static void notNullOrEmpty(String string, String message)
          Checks that the specified String is not null or empty, throws exception if it is.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

notNull

public static void notNull(Object obj,
                           String message)
                    throws IllegalArgumentException
Checks that object is not null, throws exception if it is.

Parameters:
obj - The object to check
message - The exception message
Throws:
IllegalArgumentException - Thrown if obj is null

notEmpty

public static void notEmpty(Collection<?> collection,
                            String message)
                     throws IllegalArgumentException
Checks that collection is not null or empty, throws exception if it is.

Parameters:
collection - The collection to be checked
message - The exception message
Throws:
IllegalArgumentException - Thrown if collection is null or empty

notNullOrEmpty

public static void notNullOrEmpty(String string,
                                  String message)
                           throws IllegalArgumentException
Checks that the specified String is not null or empty, throws exception if it is.

Parameters:
string - The object to check
message - The exception message
Throws:
IllegalArgumentException - Thrown if string is null

isReadable

public static void isReadable(String path,
                              String message)
                       throws IllegalArgumentException
Checks that the specified String is not null or empty and represents a readable file, throws exception if it is empty or null and does not represent a path to a file.

Parameters:
path - The path to check
message - The exception message
Throws:
IllegalArgumentException - Thrown if path is empty, null or invalid

notNullAndNoNullValues

public static void notNullAndNoNullValues(Object[] objects,
                                          String message)
Checks that the specified array is not null or contain any null values.

Parameters:
objects - The object to check
message - The exception message

ShrinkWrap Resolver Aggregator 1.1.0-alpha-2

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.