PacktLib: Getting Started with Google Guava

Getting Started with Google Guava

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Getting Started

Introducing Google Guava

The case for using Guava

What is this book about?

Installing Guava

Using Guava with Maven or Gradle

Summary

Basic Guava Utilities

Using the Joiner class

Using the Splitter class

Working with strings in Guava

Using the CharMatcher class

Using the Preconditions class

Object utilities

Summary

Functional Programming with Guava

Using the Function interface

Using the Functions class

Using the Predicate interface

Using the Predicates class

Using the Supplier interface

Using the Suppliers class

Summary

Working with Collections

The FluentIterable class

Lists

Sets

Maps

Multimaps

BiMap

Table

Range

Immutable collections

Ordering

Summary

Concurrency

Synchronizing threads

Monitor

ListenableFuture

FutureCallback

SettableFuture

AsyncFunction

FutureFallback

Futures

RateLimiter

Summary

Guava Cache

MapMaker

Guava caches

CacheBuilder

CacheBuilderSpec

CacheLoader

CacheStats

RemovalListener

Summary

The EventBus Class

EventBus

Subscribe – An example

Event Publishing – An example

Finer-grained subscribing

Unsubscribing to events

AsyncEventBus

DeadEvents

Dependency injection

Summary

Working with Files

Copying a file

Moving/renaming a File

Working with files as strings

Hashing a file

Writing to files

InputSupplier and OutputSupplier

ByteSource

ByteSink

Copying from a ByteSource class to a ByteSink class

ByteStreams and CharStreams

Closer

BaseEncoding

Summary

Odds and Ends

Creating proper hash functions

BloomFilter

Optional

Throwables

Summary

Index