Getting Started with Google Guava

Google Guava can transform the way you work with Java and this book shows you how. From beginner to expert, everyone can benefit from this smart guide that teaches faster, better coding.
Preview in Mapt

Getting Started with Google Guava

Bill Bejeck

1 customer reviews
Google Guava can transform the way you work with Java and this book shows you how. From beginner to expert, everyone can benefit from this smart guide that teaches faster, better coding.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$7.50
RRP $14.99
Save 49%
Print + eBook
$24.99
RRP $24.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$7.50
$24.99
$29.99 p/m after trial
RRP $14.99
RRP $24.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Getting Started with Google Guava Book Cover
Getting Started with Google Guava
$ 14.99
$ 7.50
Python: Journey from Novice to Expert Book Cover
Python: Journey from Novice to Expert
$ 69.99
$ 10.00
Buy 2 for $17.50
Save $67.48
Add to Cart

Book Details

ISBN 139781783280155
Paperback142 pages

Book Description

Java continues to maintain its popularity and is still one of the main languages used in the software industry today. But there are things in Java that are difficult to do that can be made easier; that’s where Guava comes in. Guava provides developers with a way to write better code, with less effort.

Getting Started with Google Guava will show the reader how to start improving their code from the very first chapter. Packed with examples and loads of source code, this book will have an immediate impact on how you work with Java.

This book starts with using Guava to help with the common tasks that Java developers perform. Then you’ll work your way through more specialized situations and finally some great functionality Guava provides that can add a lot of power to your applications with little effort. You will learn about Guava’s famous Collections classes that add unique features, like the Bi-Map, to Java’s already great Collection classes. We’ll see how to add some functional programming aspects to our code. We will also learn about using a self-loading cache for improved performance in our applications, and how to use the EventBus to create software that takes advantage of event-based programming.

Table of Contents

Chapter 1: Getting Started
Introducing Google Guava
The case for using Guava
What is this book about?
Installing Guava
Using Guava with Maven or Gradle
Summary
Chapter 2: 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
Chapter 3: 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
Chapter 4: Working with Collections
The FluentIterable class
Lists
Sets
Maps
Multimaps
BiMap
Table
Range
Immutable collections
Ordering
Summary
Chapter 5: Concurrency
Synchronizing threads
Monitor
ListenableFuture
FutureCallback
SettableFuture
AsyncFunction
FutureFallback
Futures
RateLimiter
Summary
Chapter 6: Guava Cache
MapMaker
Guava caches
CacheBuilder
CacheBuilderSpec
CacheLoader
CacheStats
RemovalListener
Summary
Chapter 7: The EventBus Class
EventBus
Subscribe – An example
Event Publishing – An example
Finer-grained subscribing
Unsubscribing to events
AsyncEventBus
DeadEvents
Dependency injection
Summary
Chapter 8: 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
Chapter 9: Odds and Ends
Creating proper hash functions
BloomFilter
Optional
Throwables
Summary

What You Will Learn

  • Master String manipulation with ease including creating a HashMap from formatted text
  • Harness the power of functional programming with Functions and Predicates
  • Use the power of Guava’s Collections classes
  • Get to grips with better ways of writing and reading files with less boilerplate
  • Improve synchronization with the Monitor
  • Create and use a self-loading cache for better performance
  • Leverage the power of event-based programming with the EventBus
  • Never get another NullPointerException by using the Optional class

Authors

Table of Contents

Chapter 1: Getting Started
Introducing Google Guava
The case for using Guava
What is this book about?
Installing Guava
Using Guava with Maven or Gradle
Summary
Chapter 2: 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
Chapter 3: 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
Chapter 4: Working with Collections
The FluentIterable class
Lists
Sets
Maps
Multimaps
BiMap
Table
Range
Immutable collections
Ordering
Summary
Chapter 5: Concurrency
Synchronizing threads
Monitor
ListenableFuture
FutureCallback
SettableFuture
AsyncFunction
FutureFallback
Futures
RateLimiter
Summary
Chapter 6: Guava Cache
MapMaker
Guava caches
CacheBuilder
CacheBuilderSpec
CacheLoader
CacheStats
RemovalListener
Summary
Chapter 7: The EventBus Class
EventBus
Subscribe – An example
Event Publishing – An example
Finer-grained subscribing
Unsubscribing to events
AsyncEventBus
DeadEvents
Dependency injection
Summary
Chapter 8: 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
Chapter 9: Odds and Ends
Creating proper hash functions
BloomFilter
Optional
Throwables
Summary

Book Details

ISBN 139781783280155
Paperback142 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Python: Journey from Novice to Expert Book Cover
Python: Journey from Novice to Expert
$ 69.99
$ 10.00
Python Machine Learning - Second Edition Book Cover
Python Machine Learning - Second Edition
$ 31.99
$ 10.00
Learning Java Lambdas Book Cover
Learning Java Lambdas
$ 23.99
$ 10.00
Learning Google Guice Book Cover
Learning Google Guice
$ 17.99
$ 9.00
Mastering TypeScript - Second Edition Book Cover
Mastering TypeScript - Second Edition
$ 39.99
$ 10.00
Architecting Modern Java EE Applications Book Cover
Architecting Modern Java EE Applications
$ 39.99
$ 10.00