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 ensureActiveCommandContext(String operation)
           
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 ensureEquals(Class<? extends ProcessEngineException> exceptionClass, String variableName, long obj1, long obj2)
           
static void ensureEquals(String variableName, long obj1, long obj2)
           
static void ensureGreaterThanOrEqual(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, long value1, long value2)
           
static void ensureGreaterThanOrEqual(String variableName, long value1, long value2)
           
static void ensureGreaterThanOrEqual(String message, String variableName, long value1, long value2)
           
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 variableName, Collection<?> 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 variableName, Collection collection, int elements)
           
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, Long value)
           
static void ensurePositive(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Long value)
           
static void ensurePositive(String variableName, Long value)
           
static void ensurePositive(String message, String variableName, Long value)
           
static void ensureValidIndividualResourceId(Class<? extends ProcessEngineException> exceptionClass, String message, String id)
           
static void ensureValidIndividualResourceId(String message, String id)
           
static void ensureValidIndividualResourceIds(Class<? extends ProcessEngineException> exceptionClass, String message, Collection<String> ids)
           
static void ensureValidIndividualResourceIds(String message, Collection<String> ids)
           
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)

ensureEquals

public static void ensureEquals(Class<? extends ProcessEngineException> exceptionClass,
                                String variableName,
                                long obj1,
                                long obj2)

ensureEquals

public static void ensureEquals(String variableName,
                                long obj1,
                                long obj2)

ensurePositive

public static void ensurePositive(String variableName,
                                  Long value)

ensurePositive

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

ensurePositive

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

ensurePositive

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

ensureGreaterThanOrEqual

public static void ensureGreaterThanOrEqual(String variableName,
                                            long value1,
                                            long value2)

ensureGreaterThanOrEqual

public static void ensureGreaterThanOrEqual(String message,
                                            String variableName,
                                            long value1,
                                            long value2)

ensureGreaterThanOrEqual

public static void ensureGreaterThanOrEqual(Class<? extends ProcessEngineException> exceptionClass,
                                            String message,
                                            String variableName,
                                            long value1,
                                            long value2)

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 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 variableName,
                                          Collection collection,
                                          int elements)

ensureNumberOfElements

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

ensureValidIndividualResourceId

public static void ensureValidIndividualResourceId(String message,
                                                   String id)

ensureValidIndividualResourceId

public static void ensureValidIndividualResourceId(Class<? extends ProcessEngineException> exceptionClass,
                                                   String message,
                                                   String id)

ensureValidIndividualResourceIds

public static void ensureValidIndividualResourceIds(String message,
                                                    Collection<String> ids)

ensureValidIndividualResourceIds

public static void ensureValidIndividualResourceIds(Class<? extends ProcessEngineException> exceptionClass,
                                                    String message,
                                                    Collection<String> ids)

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)

ensureActiveCommandContext

public static void ensureActiveCommandContext(String operation)


Copyright © 2017 camunda services GmbH. All rights reserved.