Class Conditionals

java.lang.Object
com.broadleafcommerce.metadata.dsl.core.utils.Conditionals

public final class Conditionals extends Object
Utility class with helpers for creating Conditional.
Author:
Nick Crum (ncrum)
  • Method Details

    • when

      public static DefaultPropertyConditional when(String field)
      Creates a new property conditional for the provided property name.
      Parameters:
      field - the name of the property
      Returns:
      the conditional
    • whenCollection

      public static DefaultCollectionConditional whenCollection(String field)
      Creates a new collection conditional for the provided property name.
      Parameters:
      field - the name of the property
      Returns:
      the conditional
    • and

      public static DefaultLogicalConditional and(Conditional<?>... conditionals)
      Creates a new logical-and conditional for the provided conditionals.
      Parameters:
      conditionals - the conditionals to logical-and
      Returns:
      the conditional
    • and

      public static DefaultLogicalConditional and(List<Conditional<?>> conditionals)
      Creates a new logical-and conditional for the provided conditionals.
      Parameters:
      conditionals - the conditionals to logical-and
      Returns:
      the conditional
    • or

      public static DefaultLogicalConditional or(Conditional<?>... conditionals)
      Creates a new logical-or conditional for the provided conditionals.
      Parameters:
      conditionals - the conditionals to logical-or
      Returns:
      the conditional
    • or

      public static DefaultLogicalConditional or(List<Conditional<?>> conditionals)
      Creates a new logical-or conditional for the provided conditionals.
      Parameters:
      conditionals - the conditionals to logical-or
      Returns:
      the conditional
    • not

      public static DefaultLogicalConditional not(Conditional<?>... conditionals)
      Creates a new logical-not conditional for the provided conditionals.
      Parameters:
      conditionals - the conditionals to logical-not
      Returns:
      the conditional
    • not

      public static DefaultLogicalConditional not(List<Conditional<?>> conditionals)
      Creates a new logical-not conditional for the provided conditionals.
      Parameters:
      conditionals - the conditionals to logical-not
      Returns:
      the conditional