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