com.googlecode.objectify.condition
Class ValueIf<T>

java.lang.Object
  extended by com.googlecode.objectify.condition.ValueIf<T>
All Implemented Interfaces:
If<T,java.lang.Object>
Direct Known Subclasses:
IfDefault, IfEmpty, IfEmptyString, IfFalse, IfNotEmpty, IfNotNull, IfNotZero, IfNull, IfTrue, IfZero

public abstract class ValueIf<T>
extends java.lang.Object
implements If<T,java.lang.Object>

Base class for If classes that test against a simple value. This is the most common case; IfNull, IfFalse, IfDefault, etc.

All concrete instances of this interface must have either a no-arg constructor or a constructor that takes Class<?>, Field parameters.

Author:
Jeff Schnitzer

Constructor Summary
ValueIf()
           
 
Method Summary
abstract  boolean matches(T value)
          Override this method to test a field value for your condition.
 boolean matches(T value, java.lang.Object onPojo)
          Test a value (for a field) and/or an entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueIf

public ValueIf()
Method Detail

matches

public abstract boolean matches(T value)
Override this method to test a field value for your condition. For example, for a class IfNull, return true if the value is null.


matches

public final boolean matches(T value,
                             java.lang.Object onPojo)
Description copied from interface: If
Test a value (for a field) and/or an entity.

Specified by:
matches in interface If<T,java.lang.Object>
Parameters:
value - is the actual value of a particular field
onPojo - is the entity object on which the field/value exists
Returns:
true if the value matches the condition defined by an instance of this interface.


Copyright © 2011 Jeff Schnitzer and a gang of pirates. All Rights Reserved. Build version: 3.1