Package org.knowm.xchange.utils
Class Assert
java.lang.Object
org.knowm.xchange.utils.Assert
Abstract class to provide the following to framework:
- Provision of useful assertions to trap programmer errors early
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Asserts that a String is not null and of a certain lengthstatic void
hasSize
(Collection<?> input, int length, String message) Asserts that a Collection is not null and of a certain sizestatic void
Asserts that a condition is truestatic void
Asserts that an object is not null
-
Constructor Details
-
Assert
public Assert()
-
-
Method Details
-
isTrue
Asserts that a condition is true- Parameters:
condition
- The condition under testmessage
- The message for any exception
-
notNull
Asserts that an object is not null- Parameters:
object
- The object under testmessage
- The message for any exception
-
hasLength
Asserts that a String is not null and of a certain length- Parameters:
input
- The input under testmessage
- The message for any exception
-
hasSize
Asserts that a Collection is not null and of a certain size- Parameters:
input
- The input under testmessage
- The message for any exception
-