org.springmodules.validation.util.condition.common
Class InstanceOfCondition
java.lang.Object
org.springmodules.validation.util.condition.AbstractCondition
org.springmodules.validation.util.condition.common.InstanceOfCondition
- All Implemented Interfaces:
- Condition
public class InstanceOfCondition
- extends AbstractCondition
A condition that checks whether the checked object is of a specific type.
- Author:
- Uri Boness
Constructor Summary |
InstanceOfCondition(Class clazz)
Constructs a new InstanceOfCondition with a given class the checked object will be checked against. |
Method Summary |
boolean |
doCheck(Object object)
Checks whether the given object is an instance of the class associated with this condition. |
Class |
getClazz()
Returns the class associated with this condition. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InstanceOfCondition
public InstanceOfCondition(Class clazz)
- Constructs a new InstanceOfCondition with a given class the checked object will be checked against.
- Parameters:
clazz
- The class the checked object will be checked against.
doCheck
public boolean doCheck(Object object)
- Checks whether the given object is an instance of the class associated with this condition.
- Specified by:
doCheck
in class AbstractCondition
- Parameters:
object
- The object to be checked.
- Returns:
true
if the given object is an instance of the class associated with this condition,
false
otherwise. Note: if the given object is null
, false
will be returned.
getClazz
public Class getClazz()
- Returns the class associated with this condition.
- Returns:
- The class associated with this condition.
Copyright © 2009. All Rights Reserved.