Guava provides the Throwables class which contains a number of static utility methods to work with instances of Java Throwable. Exception handling is a common component in nearly all java programs and getting it correct and consistently printing out the right information can be tricky. Navigating stack traces is not always straightforward and extracting the relevant information is cumbersome. Thankfully, Throwables makes it much easier to print and extract the needed data.
Articles
Guava Collections Tutorial
Perhaps at the foundation of Guava are its utilities for working with Java collections. After all, Guava started at as The Google Collections Library. By far, more classes live in the com.google.common.collect package than any other proving its significance to Guava.
Read More
Guava Files Tutorial
Unfortunately, the out-of-the-box tools for manipulating files, as well as, reading, and writing files Java provides are not as streamlined as they could be. Guava provides a number of utilities for working with Java File objects.
Read More
Guava Objects and MoreObjects Tutorial
The Guava Objects and MoreObjects classes provide utilities for a number of common Java idioms.
Guava Preconditions Tutorial
In this article, we will examine how and why to use Guava Preconditions. Guava Preconditions provide a number of static methods to verify a constructor or a method in Java is invoked with the proper arguments or parameters. Preconditions standardize the way an application handles such errors and eliminates the mundane task of repeatedly implementing similar blocks of code.
Read More
Guava Predicate Tutorial
We will be examining several use cases for Guava Predicates. Guava Predicates provide a way to quickly and efficiently filter and transform collections based upon some sort of criteria.
What is Guava?
Guava is an open source Java library developed by Google. The purpose of the library is to help developers utilize best coding practices, reduce potential coding errors, and to simplify common coding constructs.
Specifically, Guava provides a number of utility methods for providing parameter validation, concurrent programming, I/O, string manipulation, utilities for collections, caching, hashing, and annotations. It aims at eliminating a number of menial tasks that developers often have to implement for a wide variety of functionality.
Guava is a fairly common library utilized across many software development companies in a variety of industries. Understanding its fundamentals is becoming increasingly necessary for a Java developer. As far back as 2013, it was ranked as the 8th most popular 3rd party Java library on GitHub. Stay tuned for our upcoming Guava tutorials.
What is the Factory Design Pattern?
The Factory Design Pattern is a creational design pattern.
Why is it important to override hashCode and equals in Java?
Interview question: Why is it important to override hashCode and equals in Java?
What are the differences between a HashMap and a TreeMap in Java?
Interview question: What are the differences between a HashMap and a TreeMap in Java?