org.jclouds.predicates
Class Validator<T>

java.lang.Object
  extended by org.jclouds.predicates.Validator<T>
Type Parameters:
T - Type of object to be validated. For generic validation (where object's class is determined in validate(Object), use Object.
All Implemented Interfaces:
com.google.common.base.Predicate<T>
Direct Known Subclasses:
AllLowerCaseValidator, DnsNameValidator, FilesystemBlobKeyValidator, FilesystemContainerNameValidator

public abstract class Validator<T>
extends Object
implements com.google.common.base.Predicate<T>

Abstract class that creates a bridge between Predicate and ParamValidatorss.

Author:
Oleksiy Yarmula
See Also:
Predicate

Constructor Summary
Validator()
           
 
Method Summary
 boolean apply(T t)
           
abstract  void validate(T t)
          Validates the parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.common.base.Predicate
equals
 

Constructor Detail

Validator

public Validator()
Method Detail

apply

public boolean apply(@Nullable
                     T t)
Specified by:
apply in interface com.google.common.base.Predicate<T>

validate

public abstract void validate(@Nullable
                              T t)
                       throws IllegalArgumentException
Validates the parameter

Parameters:
t - parameter to be validated
Throws:
IllegalArgumentException - if validation failed


Copyright © 2009-2011 jclouds. All Rights Reserved.