java.lang.Object
org.seppiko.commons.utils.Assert
Assert
- Author:
- Leonard Woo
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidif string text length is 0 throw messagestatic voidif string text has not any char without whitespace throw messagestatic voidif true throw messagestatic voidif not true throw messagestatic RuntimeExceptionThrow exception with RuntimeException.
-
Method Details
-
isTrue
if not true throw message- Parameters:
expression- boolean expression.message- message.- Throws:
IllegalArgumentException- if expression is false throw this.
-
isFalse
if true throw message- Parameters:
expression- boolean expression.message- message.- Throws:
IllegalArgumentException- if expression is true throw this.
-
hasLength
if string text length is 0 throw message- Parameters:
text- string text.message- message.- Throws:
NullPointerException- if text have not any string throw this.
-
hasText
if string text has not any char without whitespace throw message- Parameters:
text- string text.message- message.- Throws:
NullPointerException- if text have not any char throw this.
-
sneakyThrow
Throw exception with RuntimeException.try { throw new Throwable(); } catch (Throwable t) { throw Assert.sneakyThrow(t); }- Parameters:
t- any exception.- Returns:
- RuntimeException.
- Throws:
NullPointerException- if t is null throw this.
-