org.modelmapper
Class Conditions

java.lang.Object
  extended by org.modelmapper.Conditions

public class Conditions
extends Object

Condition utilities and implementations. This class can be extended by a PropertyMap to provide convenient access to methods.

Author:
Jonathan Halterman

Constructor Summary
Conditions()
           
 
Method Summary
static
<S,D> Condition<S,D>
and(Condition<S,D> condition1, Condition<S,D> condition2)
          Returns a new condition that applies if condition1 AND condition2 apply.
static Condition<?,?> isNotNull()
          Returns a condition that applies when the mapping source is not null.
static Condition<?,?> isNull()
          Returns a condition that applies when the mapping source is null.
static
<S,D> Condition<S,D>
not(Condition<S,D> condition)
          Returns a condition that does NOT apply when the given condition applies.
static
<S,D> Condition<S,D>
or(Condition<S,D> condition1, Condition<S,D> condition2)
          Returns a new condition that applies if condition1 OR condition2 apply.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Conditions

public Conditions()
Method Detail

and

public static <S,D> Condition<S,D> and(Condition<S,D> condition1,
                                       Condition<S,D> condition2)
Returns a new condition that applies if condition1 AND condition2 apply.

Returns:
new condition
Throws:
IllegalArgumentException - if condition1 or condition2 is null

isNotNull

public static Condition<?,?> isNotNull()
Returns a condition that applies when the mapping source is not null.


isNull

public static Condition<?,?> isNull()
Returns a condition that applies when the mapping source is null.


not

public static <S,D> Condition<S,D> not(Condition<S,D> condition)
Returns a condition that does NOT apply when the given condition applies.

Throws:
IllegalArgumentException - if condition is null

or

public static <S,D> Condition<S,D> or(Condition<S,D> condition1,
                                      Condition<S,D> condition2)
Returns a new condition that applies if condition1 OR condition2 apply.

Returns:
new condition
Throws:
IllegalArgumentException - if condition1 or condition2 is null


Copyright © 2011. All Rights Reserved.