I was looking around java.net – somewhere I haven’t been for a while – and noticed an article discussing a few new Java tools. I cloned the project and poked around a bit. I found reference to the Retrofit project and did a deeper dive. It looks like it’s most popular on the Android, but I see no reason why it couldn’t be used in a regular ol’ Java SE-type of application. Basically, Retrofit supplies an abstraction for accessing RESTful web services.
To put it to the test, I found a public API called “Brewery DB” and used an online tool to churn out some POJOs based on the sample JSON for the web service. Unfortunately, it looks like the RESTful service I chose has died on the vine. In any case, I was able to query the API for its list of beers and get populated Java objects out of it. I hope to revisit Retrofit again in the near future.