org.camunda.bpm.engine.impl.util
Class EnsureUtil

java.lang.Object
  extended by org.camunda.bpm.engine.impl.util.EnsureUtil

public final class EnsureUtil
extends Object

Author:
Sebastian Menski, Roman Smirnov

Constructor Summary
EnsureUtil()
           
 
Method Summary
static void ensureAtLeastOneNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String message, String... values)
           
static void ensureAtLeastOneNotEmpty(String message, String... values)
           
static void ensureAtLeastOneNotNull(Class<? extends ProcessEngineException> exceptionClass, String message, Object... values)
           
static void ensureAtLeastOneNotNull(String message, Object... values)
           
static void ensureInstanceOf(Class<? extends ProcessEngineException> exceptionClass, String variableName, Object value, Class<?> expectedClass)
           
static void ensureInstanceOf(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Object value, Class<?> expectedClass)
           
static void ensureInstanceOf(String variableName, Object value, Class<?> expectedClass)
           
static void ensureInstanceOf(String message, String variableName, Object value, Class<?> expectedClass)
           
static void ensureNotContainsEmptyString(Class<? extends ProcessEngineException> exceptionClass, String variableName, Collection<String> values)
           
static void ensureNotContainsEmptyString(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Collection<String> values)
           
static void ensureNotContainsEmptyString(String variableName, Collection<String> values)
           
static void ensureNotContainsEmptyString(String message, String variableName, Collection<String> values)
           
static void ensureNotContainsNull(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Collection<?> values)
           
static void ensureNotContainsNull(String variableName, Collection<?> values)
           
static void ensureNotContainsNull(String message, String variableName, Collection<?> values)
           
static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String variableName, Collection collection)
           
static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String variableName, Map map)
           
static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String variableName, String value)
           
static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Collection collection)
           
static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Map map)
           
static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, String value)
           
static void ensureNotEmpty(String variableName, Collection collection)
           
static void ensureNotEmpty(String variableName, Map map)
           
static void ensureNotEmpty(String variableName, String value)
           
static void ensureNotEmpty(String message, String variableName, Collection collection)
           
static void ensureNotEmpty(String message, String variableName, Map map)
           
static void ensureNotEmpty(String message, String variableName, String value)
           
static void ensureNotNull(Class<? extends ProcessEngineException> exceptionClass, String variableName, Object... values)
           
static void ensureNotNull(Class<? extends ProcessEngineException> exceptionClass, String variableName, Object value)
           
static void ensureNotNull(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Object... values)
           
static void ensureNotNull(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Object value)
           
static void ensureNotNull(String variableName, Object... values)
           
static void ensureNotNull(String variableName, Object value)
           
static void ensureNotNull(String message, String variableName, Object... values)
           
static void ensureNotNull(String message, String variableName, Object value)
           
static void ensureNull(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Object value)
           
static void ensureNumberOfElements(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Collection collection, int elements)
           
static void ensureNumberOfElements(String variableName, Collection collection, int elements)
           
static void ensureNumberOfElements(String message, String variableName, Collection collection, int elements)
           
static void ensureOnlyOneNotNull(Class<? extends ProcessEngineException> exceptionClass, String message, Object... values)
           
static void ensureOnlyOneNotNull(String message, Object... values)
           
static void ensurePositive(Class<? extends ProcessEngineException> exceptionClass, String variableName, Integer value)
           
static void ensurePositive(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Integer value)
           
static void ensurePositive(String variableName, Integer value)
           
static void ensurePositive(String message, String variableName, Integer value)
           
protected static String formatMessage(String message, String variableName, String description)
           
protected static String formatMessageElement(String element, String delimiter)
           
protected static
<T extends ProcessEngineException>
T
generateException(Class<T> exceptionClass, String message, String variableName, String description)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnsureUtil

public EnsureUtil()
Method Detail

ensureNotNull

public static void ensureNotNull(String variableName,
                                 Object value)

ensureNotNull

public static void ensureNotNull(Class<? extends ProcessEngineException> exceptionClass,
                                 String variableName,
                                 Object value)

ensureNotNull

public static void ensureNotNull(String message,
                                 String variableName,
                                 Object value)

ensureNotNull

public static void ensureNotNull(Class<? extends ProcessEngineException> exceptionClass,
                                 String message,
                                 String variableName,
                                 Object value)

ensureNull

public static void ensureNull(Class<? extends ProcessEngineException> exceptionClass,
                              String message,
                              String variableName,
                              Object value)

ensureNotNull

public static void ensureNotNull(String variableName,
                                 Object... values)

ensureNotNull

public static void ensureNotNull(Class<? extends ProcessEngineException> exceptionClass,
                                 String variableName,
                                 Object... values)

ensureNotNull

public static void ensureNotNull(String message,
                                 String variableName,
                                 Object... values)

ensureNotNull

public static void ensureNotNull(Class<? extends ProcessEngineException> exceptionClass,
                                 String message,
                                 String variableName,
                                 Object... values)

ensureNotEmpty

public static void ensureNotEmpty(String variableName,
                                  String value)

ensureNotEmpty

public static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass,
                                  String variableName,
                                  String value)

ensureNotEmpty

public static void ensureNotEmpty(String message,
                                  String variableName,
                                  String value)

ensureNotEmpty

public static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass,
                                  String message,
                                  String variableName,
                                  String value)

ensureNotEmpty

public static void ensureNotEmpty(String variableName,
                                  Collection collection)

ensureNotEmpty

public static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass,
                                  String variableName,
                                  Collection collection)

ensureNotEmpty

public static void ensureNotEmpty(String message,
                                  String variableName,
                                  Collection collection)

ensureNotEmpty

public static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass,
                                  String message,
                                  String variableName,
                                  Collection collection)

ensureNotEmpty

public static void ensureNotEmpty(String variableName,
                                  Map map)

ensureNotEmpty

public static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass,
                                  String variableName,
                                  Map map)

ensureNotEmpty

public static void ensureNotEmpty(String message,
                                  String variableName,
                                  Map map)

ensureNotEmpty

public static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass,
                                  String message,
                                  String variableName,
                                  Map map)

ensurePositive

public static void ensurePositive(String variableName,
                                  Integer value)

ensurePositive

public static void ensurePositive(Class<? extends ProcessEngineException> exceptionClass,
                                  String variableName,
                                  Integer value)

ensurePositive

public static void ensurePositive(String message,
                                  String variableName,
                                  Integer value)

ensurePositive

public static void ensurePositive(Class<? extends ProcessEngineException> exceptionClass,
                                  String message,
                                  String variableName,
                                  Integer value)

ensureInstanceOf

public static void ensureInstanceOf(String variableName,
                                    Object value,
                                    Class<?> expectedClass)

ensureInstanceOf

public static void ensureInstanceOf(Class<? extends ProcessEngineException> exceptionClass,
                                    String variableName,
                                    Object value,
                                    Class<?> expectedClass)

ensureInstanceOf

public static void ensureInstanceOf(String message,
                                    String variableName,
                                    Object value,
                                    Class<?> expectedClass)

ensureInstanceOf

public static void ensureInstanceOf(Class<? extends ProcessEngineException> exceptionClass,
                                    String message,
                                    String variableName,
                                    Object value,
                                    Class<?> expectedClass)

ensureOnlyOneNotNull

public static void ensureOnlyOneNotNull(String message,
                                        Object... values)

ensureOnlyOneNotNull

public static void ensureOnlyOneNotNull(Class<? extends ProcessEngineException> exceptionClass,
                                        String message,
                                        Object... values)

ensureAtLeastOneNotNull

public static void ensureAtLeastOneNotNull(String message,
                                           Object... values)

ensureAtLeastOneNotNull

public static void ensureAtLeastOneNotNull(Class<? extends ProcessEngineException> exceptionClass,
                                           String message,
                                           Object... values)

ensureAtLeastOneNotEmpty

public static void ensureAtLeastOneNotEmpty(String message,
                                            String... values)

ensureAtLeastOneNotEmpty

public static void ensureAtLeastOneNotEmpty(Class<? extends ProcessEngineException> exceptionClass,
                                            String message,
                                            String... values)

ensureNotContainsEmptyString

public static void ensureNotContainsEmptyString(String variableName,
                                                Collection<String> values)

ensureNotContainsEmptyString

public static void ensureNotContainsEmptyString(String message,
                                                String variableName,
                                                Collection<String> values)

ensureNotContainsEmptyString

public static void ensureNotContainsEmptyString(Class<? extends ProcessEngineException> exceptionClass,
                                                String variableName,
                                                Collection<String> values)

ensureNotContainsEmptyString

public static void ensureNotContainsEmptyString(Class<? extends ProcessEngineException> exceptionClass,
                                                String message,
                                                String variableName,
                                                Collection<String> values)

ensureNotContainsNull

public static void ensureNotContainsNull(String variableName,
                                         Collection<?> values)

ensureNotContainsNull

public static void ensureNotContainsNull(String message,
                                         String variableName,
                                         Collection<?> values)

ensureNotContainsNull

public static void ensureNotContainsNull(Class<? extends ProcessEngineException> exceptionClass,
                                         String message,
                                         String variableName,
                                         Collection<?> values)

ensureNumberOfElements

public static void ensureNumberOfElements(String variableName,
                                          Collection collection,
                                          int elements)

ensureNumberOfElements

public static void ensureNumberOfElements(String message,
                                          String variableName,
                                          Collection collection,
                                          int elements)

ensureNumberOfElements

public static void ensureNumberOfElements(Class<? extends ProcessEngineException> exceptionClass,
                                          String message,
                                          String variableName,
                                          Collection collection,
                                          int elements)

generateException

protected static <T extends ProcessEngineException> T generateException(Class<T> exceptionClass,
                                                                        String message,
                                                                        String variableName,
                                                                        String description)

formatMessage

protected static String formatMessage(String message,
                                      String variableName,
                                      String description)

formatMessageElement

protected static String formatMessageElement(String element,
                                             String delimiter)


Copyright © 2015 camunda services GmbH. All rights reserved.