Package org.gbif.api.util
Class OffsetDateTimeUtils
java.lang.Object
org.gbif.api.util.OffsetDateTimeUtils
Utility class for null-safe OffsetDateTime operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intCompares two OffsetDateTime values in a null-safe manner.static booleanChecks if two OffsetDateTime values are equal in a null-safe manner.
-
Method Details
-
compareOffsetDateTime
Compares two OffsetDateTime values in a null-safe manner. Null values are considered to be greater than non-null values (sorted to the end).- Parameters:
dt1- first OffsetDateTime to comparedt2- second OffsetDateTime to compare- Returns:
- a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second
-
isEqualOffsetDateTime
Checks if two OffsetDateTime values are equal in a null-safe manner.- Parameters:
dt1- first OffsetDateTime to comparedt2- second OffsetDateTime to compare- Returns:
- true if both are null or both are equal, false otherwise
-