While I was just about to use an old class that is about 2 years old I realized it used the old Springframework. The new framework is rather hard to navigate, and I don’t need it for anything else.
The class is a nice implementation of strtotime (AKA String to Time). https://github.com/collegeman/stringtotime/blob/master/src/main/java/com/clutch/dates/StringToTime.java
Of course when I go to compile all I get is this: NoClassDefFoundError occured : org/springframework/util/Assert and even when I try including an old spring jar it makes no difference.
The only part of the class depending on it is the .util.Assert:
Assert.notNull(dateTimeString);
Assert.notNull(now);
Assert.notNull(simpleDateFormat);
Is anyone aware of the following:
- A link to the Assert source (can’t find it via Google)
- A substitute library
- A better class just like StringToTime
Thanks!
Guava’s Preconditions. google-guava is an excellent addition to your application.
Preconditions.checkNotNullis what you need. There are overloaded versions that allow you to specify the error message etc.