Class Conditions

java.lang.Object
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.
  • Constructor Details

    • Conditions

      public Conditions()
  • Method Details

    • 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.
    • isType

      public static Condition<?,?> isType(Class<?> type)
      Returns a condition that applies when the mapping source is of the type type.
    • 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