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.
Month: August 2017
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.