Category Archives: Guava

PHPHOST BLOG

Web Hosting Related Articles You May Need

Determining Presence of Characters or Integers in String with Guava CharMatcher and Apache Commons Lang StringUtils

A recent Reddit post asked the question, “Is there a predefined method for checking if a variable value contains a particular character or integer?” That question-based title was also asked a different way, “A method or quick way for checking if a vari… Continue reading

Posted in Apache Commons, Guava, Java (General), Syndicated | Comments Off on Determining Presence of Characters or Integers in String with Guava CharMatcher and Apache Commons Lang StringUtils

Recent Interesting Software Development Posts – 1 May 2012

This post references and very briefly summarizes several recent posts on subjects of interest to software developers such as NetBeans 7.1.2, progress on Java 8’s Lambda Expressions, Guava Release 12, TestNG, Scala, and the expense of ineffective meetin… Continue reading

Posted in Guava, Java SE 8, NetBeans, Syndicated, Unit Testing | Comments Off on Recent Interesting Software Development Posts – 1 May 2012

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 | Comments Off on Guava Release 11’s IntMath

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 | Comments Off on Sneaking a Peek at Guava Release 11

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 | Comments Off on File Management in Java with Guava’s Files Class

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 | Comments Off on Two Generally Useful Guava Annotations

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 | Comments Off on Guava’s Strings Class

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 | Comments Off on Filtering and Transforming Java Collections with Guava’s Collections2

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 | Comments Off on Immutable Collections, Guava-Style

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 | Comments Off on Guava Stopwatch