java.lang.Object
org.seppiko.commons.utils.Assert
Assert
- Author:
- Leonard Woo
-
Constructor Summary
Constructors -
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 voidif object array is null or length is 0 throw messagestatic RuntimeExceptionThrow exception with RuntimeException
-
Constructor Details
-
Assert
public Assert()
-
-
Method Details
-
isTrue
if not true throw message- Parameters:
expression- boolean expressionmessage- message- Throws:
IllegalArgumentException- if expression is false throw this
-
isFalse
if true throw message- Parameters:
expression- boolean expressionmessage- message- Throws:
IllegalArgumentException- if expression is true throw this
-
hasLength
if string text length is 0 throw message- Parameters:
text- string textmessage- 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 textmessage- message- Throws:
NullPointerException- if text have not any char throw this
-
notEmpty
if object array is null or length is 0 throw message- Parameters:
array- object arraymessage- message- Throws:
NullPointerException- if array is not empty throw this
-
sneakyThrow
Throw exception with RuntimeExceptiontry { throw new Throwable(); } catch (Throwable t) { throw Assert.sneakyThrow(t); }- Parameters:
t- any exception- Returns:
- RuntimeException
- Throws:
NullPointerException- if t is null throw this
-