Category Archives: Guava

PHPHOST BLOG

Web Hosting Related Articles You May Need

Guava Release 11′s IntMath

As I stated earlier in the post Sneaking a Peek at Guava Release 11, Guava Release 11 provides numerous new classes including several classes specifically related to mathematical operations. In this post, I look at one of these that is targeted at inte… Continue reading

Posted in Guava, Syndicated | Leave a comment

Sneaking a Peek at Guava Release 11

The recent reddit/java thread If you still don’t know why Guava is awesome …. references the Guava Explained Wiki page. As I was looking at this, I noticed the page focused on Guava Math Explained. I have blogged several times regarding Guava feature… Continue reading

Posted in Groovy, Guava, Syndicated | Leave a comment

File Management in Java with Guava’s Files Class

Both Groovy and Java SE 7 provide improvements for file management in Java as I discussed in posts here, here, here, and here. However, when a particular Java application is not able to yet use Java SE 7 or Groovy for its file management, an improved f… Continue reading

Posted in Guava, Syndicated | Leave a comment

Two Generally Useful Guava Annotations

Guava currently (Release 10) includes four annotations in its com.google.common.annotations package: Beta, VisibleForTesting, GwtCompatible, and GwtIncompatible. The last two are specific to use with Google Web Toolkit (GWT), but the former two can be … Continue reading

Posted in Guava, Syndicated | Leave a comment

Guava’s Strings Class

In the post Checking for Null or Empty or White Space Only String in Java, I demonstrated common approaches in the Java ecosystem (standard Java, Guava, Apache Commons Lang, and Groovy) for checking whether a String is null, empty, or white space only … Continue reading

Posted in Guava, Syndicated | Leave a comment

Filtering and Transforming Java Collections with Guava’s Collections2

One of the conveniences of Groovy is the ability to easily perform filtering and transformation operations on collections via Groovy’s closure support. Guava brings filtering and transformation on collections to standard Java and that is the subject of… Continue reading

Posted in Guava, Syndicated | Leave a comment

Immutable Collections, Guava-Style

My general preference is to use immutable classes and collections as often as possible. I have often used the Collections methods for returning unmodifiable collections. One drawback of the “unmodifiable” methods is that they only create “views” of the… Continue reading

Posted in Guava, Syndicated | Leave a comment

Guava Stopwatch

Guava’s Stopwatch is another Guava class new to Guava Release 10 (as is Optional, the subject of another recent post). As its name implies, this simple class provides a method to conveniently measure time elapsed between two code points. It has several… Continue reading

Posted in Guava, Syndicated | Leave a comment

Guava’s New Optional Class

Guava Release 10 introduces the Optional class, which can be used where one might use a null object. I have built my own classes like this before, but the advantage of Guava’s providing it is that it can be easily reused across projects and developers … Continue reading

Posted in Guava, Syndicated | Leave a comment

Guava Presents Java Throwable Stack Trace as Single String

Tip #5 of my blog post Ten Tips for Using Java Stack Traces demonstrates two example of using Java code to extract a Throwable’s (implying Error or Exception) stack trace into a single String representation using either PrintWriter or PrintStream. Thes… Continue reading

Posted in Guava, Syndicated | Leave a comment