Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative for old Springframework util.Assert?

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!

like image 230
crockpotveggies Avatar asked Sep 18 '26 23:09

crockpotveggies


1 Answers

  • commons-lang Validate
  • guava Preconditions

Here's an article comparing them.

like image 125
Bozho Avatar answered Sep 21 '26 18:09

Bozho



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!