Package org.camunda.bpm.engine.impl.util
Class EnsureUtil
java.lang.Object
org.camunda.bpm.engine.impl.util.EnsureUtil
- Author:
- Sebastian Menski, Roman Smirnov
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String
determineResourceWhitelistPattern
(ProcessEngineConfiguration processEngineConfiguration, String resourceType) 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
ensureFalse
(String message, boolean value) 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
ensureLessThan
(String message, String variable, long value1, long value2) static void
ensureNotContainsEmptyString
(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Collection<String> values) static void
ensureNotContainsEmptyString
(Class<? extends ProcessEngineException> exceptionClass, String variableName, Collection<String> values) static void
ensureNotContainsEmptyString
(String message, String variableName, Collection<String> values) static void
ensureNotContainsEmptyString
(String variableName, Collection<String> values) static void
ensureNotContainsNull
(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Collection<?> values) static void
ensureNotContainsNull
(Class<? extends ProcessEngineException> exceptionClass, String variableName, Collection<?> values) static void
ensureNotContainsNull
(String message, String variableName, Collection<?> values) static void
ensureNotContainsNull
(String variableName, Collection<?> values) static void
ensureNotEmpty
(Class<? extends ProcessEngineException> exceptionClass, String variableName, String value) static void
ensureNotEmpty
(Class<? extends ProcessEngineException> exceptionClass, String message, 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 variableName, Collection collection) static void
ensureNotEmpty
(Class<? extends ProcessEngineException> exceptionClass, String variableName, Map map) static void
ensureNotEmpty
(String variableName, String value) static void
ensureNotEmpty
(String message, 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 variableName, Collection collection) static void
ensureNotEmpty
(String variableName, Map map) static void
ensureNotNull
(Class<? extends ProcessEngineException> exceptionClass, String variableName, Object value) static void
ensureNotNull
(Class<? extends ProcessEngineException> exceptionClass, String variableName, Object... values) static void
ensureNotNull
(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Object value) static void
ensureNotNull
(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Object... values) static void
ensureNotNull
(String variableName, Object value) static void
ensureNotNull
(String variableName, Object... values) static void
ensureNotNull
(String message, String variableName, Object value) static void
ensureNotNull
(String message, String variableName, Object... values) 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
(Class<? extends ProcessEngineException> exceptionClass, String variableName, Collection collection, int elements) static void
ensureNumberOfElements
(String message, String variableName, Collection collection, int elements) static void
ensureNumberOfElements
(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
ensureTrue
(String message, boolean 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) static void
ensureWhitelistedResourceId
(CommandContext commandContext, String resourceType, String resourceId) protected static String
formatMessage
(String message, String variableName, String description) protected static String
formatMessageElement
(String element, String delimiter) protected static <T extends ProcessEngineException>
TgenerateException
(Class<T> exceptionClass, String message, String variableName, String description)
-
Constructor Details
-
EnsureUtil
public EnsureUtil()
-
-
Method Details
-
ensureNotNull
-
ensureNotNull
public static void ensureNotNull(Class<? extends ProcessEngineException> exceptionClass, String variableName, Object value) -
ensureNotNull
-
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
-
ensureNotNull
public static void ensureNotNull(Class<? extends ProcessEngineException> exceptionClass, String variableName, Object... values) -
ensureNotNull
-
ensureNotNull
public static void ensureNotNull(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Object... values) -
ensureNotEmpty
-
ensureNotEmpty
public static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String variableName, String value) -
ensureNotEmpty
-
ensureNotEmpty
public static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, String value) -
ensureNotEmpty
-
ensureNotEmpty
public static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String variableName, Collection collection) -
ensureNotEmpty
-
ensureNotEmpty
public static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Collection collection) -
ensureNotEmpty
-
ensureNotEmpty
public static void ensureNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String variableName, Map map) -
ensureNotEmpty
-
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
-
ensurePositive
-
ensurePositive
public static void ensurePositive(Class<? extends ProcessEngineException> exceptionClass, String variableName, Long value) -
ensurePositive
-
ensurePositive
public static void ensurePositive(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, Long value) -
ensureLessThan
-
ensureGreaterThanOrEqual
-
ensureGreaterThanOrEqual
-
ensureGreaterThanOrEqual
public static void ensureGreaterThanOrEqual(Class<? extends ProcessEngineException> exceptionClass, String message, String variableName, long value1, long value2) -
ensureInstanceOf
-
ensureInstanceOf
public static void ensureInstanceOf(Class<? extends ProcessEngineException> exceptionClass, String variableName, Object value, Class<?> expectedClass) -
ensureInstanceOf
-
ensureInstanceOf
-
ensureOnlyOneNotNull
-
ensureOnlyOneNotNull
public static void ensureOnlyOneNotNull(Class<? extends ProcessEngineException> exceptionClass, String message, Object... values) -
ensureAtLeastOneNotNull
-
ensureAtLeastOneNotNull
public static void ensureAtLeastOneNotNull(Class<? extends ProcessEngineException> exceptionClass, String message, Object... values) -
ensureAtLeastOneNotEmpty
-
ensureAtLeastOneNotEmpty
public static void ensureAtLeastOneNotEmpty(Class<? extends ProcessEngineException> exceptionClass, String message, String... values) -
ensureNotContainsEmptyString
-
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
-
ensureNotContainsNull
-
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
-
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
-
ensureValidIndividualResourceId
public static void ensureValidIndividualResourceId(Class<? extends ProcessEngineException> exceptionClass, String message, String id) -
ensureValidIndividualResourceIds
-
ensureValidIndividualResourceIds
public static void ensureValidIndividualResourceIds(Class<? extends ProcessEngineException> exceptionClass, String message, Collection<String> ids) -
ensureWhitelistedResourceId
public static void ensureWhitelistedResourceId(CommandContext commandContext, String resourceType, String resourceId) -
ensureTrue
-
ensureFalse
-
determineResourceWhitelistPattern
protected static String determineResourceWhitelistPattern(ProcessEngineConfiguration processEngineConfiguration, String resourceType) -
generateException
protected static <T extends ProcessEngineException> T generateException(Class<T> exceptionClass, String message, String variableName, String description) -
formatMessage
-
formatMessageElement
-
ensureActiveCommandContext
-