It's not just a matter of connector compatibility, though that's certainly a factor, but it's also a matter of physical ...
Ryobi has been making battery-powered tools for a long time ... model number of your batteries and make sure that they're compatible with whichever charger you choose before plugging it in.