Google Guava Tutorials

Source: Internet
Author: User
Tags google guava

Google Guava Official tutorial (Chinese version)

Link Translator: Shenyan, lolli tree, He Yixin, Vouzou proofreading : Fang Fei

Introduction

The Guava project contains several core libraries that are widely relied on by Google's Java projects, such as: collections [Collections], cache [caching], native type support [primitives supports], concurrent libraries [Concurrency Lib Raries], common annotations [common annotations], string handling [string processing], I/O, and so on. All of these tools are used by Google's engineers every day in product services.

Consulting Javadoc is not necessarily the most effective way to learn these libraries. Here, we want to provide more readable and explanatory explanations for the most popular and powerful features in guava with this document.

Translation Format description

    • When a class in guava is first referenced, it is linked to the Guava API documentation. such as:optional<t>.

    • When guava and JDK methods are referenced, they are typically linked to API documentation for guava or JDK, except for some well-known JDK methods. such as:Optional.of (T), Map.get (key).

    • The translator's additional description of the document is shown in italics and begins with " Translator note :".

Directory

1. Basic tools [Basic utilities]

Make it more comfortable to use the Java language

1.1 Using and avoiding null:null is ambiguous and can cause confusing mistakes, sometimes it makes people uncomfortable. Many guava tool classes reject null values with fast failures, rather than blindly accepting

1.2 Preconditions: Making conditional checks in methods easier

1.3 Common Object methods: simplifying the implementation of the object method, such as Hashcode () and ToString ()

1.4 reviews sorted by guava powerful "fluent style comparator"

1.5 Throwables: Simplifies the propagation and inspection of anomalies and errors

2. Set [Collections]

Guava extension of the JDK collection, which is the most mature and well-known part of guava

2.1 Immutable Collections: Defensive programming and performance improvements with immutable collections.

2.2 New collection types: multisets, multimaps, tables, bidirectional maps, etc.

2.3 Powerful Collection Tools class: Provides a collection tool that is not available in java.util.Collections

2.4 Extension Tool classes: make it easier to implement and extend collection classes, such as creating collection adorners, or implementing Iterators

3. cache [Caches]

Guava Cache: Local cache implementation, support for multiple cache expiration policies

4. Functional style [functional idioms]

Guava's functional support can significantly simplify your code, but use it sparingly

5. concurrency [Concurrency]

Powerful and simple abstraction, making it easier to write the right concurrency code

5.1 Listenablefuture: The future of triggering callbacks after completion

5.2 Service Framework: Abstract services that can be turned on and off to help you maintain the state logic of your service

6. String processing [Strings]

Useful string tools, including split, join, fill, and more

7. Native type [primitives]

Extend the native types (such as int, char) operations not provided by the JDK, including some types of unsigned forms

8. Interval [Ranges]

Interval APIs for comparable types, including continuous and discrete types

9. I/O

Simplifies I/O, especially I/O flow and file operations, for JAVA5 and 6 versions

10. Hash [Hash]

Provides more complex hashing implementations than Object.hashcode () and provides the implementation of the Bloom filter

11. Event bus [Eventbus]

Component communication in publish-subscribe mode, but components do not need to be explicitly registered with other components

12. Mathematical operations [Math]

Optimized, fully tested math tool classes

13. Reflection [Reflection]

Guava's Java reflection mechanism tool class

original articles, reproduced please specify: reproduced from the Concurrent programming network –ifeve.com

This article link address: Google Guava Official Tutorial (Chinese version)

The footnote information of the article is automatically generated by the WordPress Wp-posturl plugin.


Google Guava Tutorials

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.