Package org.locationtech.jts.util
Class Assert
java.lang.Object
org.locationtech.jts.util.Assert
A utility for making programming assertions.
- Version:
- 1.7
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Throws anAssertionFailedException
if the given objects are not equal, according to theequals
method.static void
Throws anAssertionFailedException
with the given message if the given objects are not equal, according to theequals
method.static void
isTrue
(boolean assertion) Throws anAssertionFailedException
if the given assertion is not true.static void
Throws anAssertionFailedException
with the given message if the given assertion is not true.static void
Always throws anAssertionFailedException
.static void
shouldNeverReachHere
(String message) Always throws anAssertionFailedException
with the given message.
-
Constructor Details
-
Assert
public Assert()
-
-
Method Details
-
isTrue
public static void isTrue(boolean assertion) Throws anAssertionFailedException
if the given assertion is not true.- Parameters:
assertion
- a condition that is supposed to be true- Throws:
AssertionFailedException
- if the condition is false
-
isTrue
Throws anAssertionFailedException
with the given message if the given assertion is not true.- Parameters:
assertion
- a condition that is supposed to be truemessage
- a description of the assertion- Throws:
AssertionFailedException
- if the condition is false
-
equals
Throws anAssertionFailedException
if the given objects are not equal, according to theequals
method.- Parameters:
expectedValue
- the correct valueactualValue
- the value being checked- Throws:
AssertionFailedException
- if the two objects are not equal
-
equals
Throws anAssertionFailedException
with the given message if the given objects are not equal, according to theequals
method.- Parameters:
expectedValue
- the correct valueactualValue
- the value being checkedmessage
- a description of the assertion- Throws:
AssertionFailedException
- if the two objects are not equal
-
shouldNeverReachHere
public static void shouldNeverReachHere()Always throws anAssertionFailedException
.- Throws:
AssertionFailedException
- thrown always
-
shouldNeverReachHere
Always throws anAssertionFailedException
with the given message.- Parameters:
message
- a description of the assertion- Throws:
AssertionFailedException
- thrown always
-