A brief introduction of guava document translation Guava

Source: Internet
Author: User

User Guide

The guava project includes some of Google's core libraries, which we rely on in Java-based projects, including: collections, caches, support for basic types, concurrency libraries, general annotations, string processing, I/O, and so on. Every one of these tools is really being used by Google every day, and it's in the production system.

But it's the most effective way to learn how to use a library in Javadoc. Here, we try to make a good exposition of some of the most popular and powerful features of guava.

The wiki is not finished yet, and some parts of it are still being built.

    • Basic tools: Make using Java the language more enjoyable
      • use and avoid Null ( Using and avoiding null ) : null may be confusing, can cause confusing errors, and of course sometimes it is uncomfortable to look at. Some guava tools reject null and fail quickly when using NULL, rather than blindly receiving null
      • preconditions (preconditions ) : makes it easier to test preconditions for your method
      • objects common methods (common Object Methods ) : Makes the method of implementing object simpler, such as hashcode () and ToString ()
      • order (ordering ) : Provides a guava powerful "fluent Comparator" class ( The ordering of the object is defined by the fluent code, as described in the document that links past)
      • exception () : Simplifies propagation and validation of exceptions and errors
    • Collection: Guava extensions for JDK collection systems. Here are some of the most mature and popular parts of guava.
      • Immutable set (immutable collections)for defensive programming, constant aggregation, and increased efficiency

      • The new collection type (collection Types)provides some examples of JDK collections that should have done better: multiset, multimap, table, bidirectional mapping, and others.
      • Powerful Collection Tool (powerful collection utilities)that provides operations that are not provided by java.util.Collection
      • Extension tool (Extension utilities): Want to write a collection of adorners? Implement an iterator? We can make it easier.
    • Cache (Caches): local cache, used properly, and supports multiple expiration (expiration) behavior
    • Functional (functional idioms): Use sparingly, guava's functional formula can be extremely effective in simplifying code
    • Concurrency (Concurrency): Powerful and simple abstraction that makes it easier to write the right concurrency code
      • Listenablefuture: The future of callbacks when done
      • Service: Can start and stop things, for you to deal with the implementation of the very difficult state logic
    • String (Strings): Some extremely useful string tools: Split, Merge, fill, and more Functions
    • Basic Type (primitives): Operations for basic types, Comparison of int and char, some JDK does not provide operation, Includes some types of signed
    • scopes (Ranges): Guava is a powerful API for dealing with the range of comparable types, continuous and discrete.
    • I/o: simplifies I/O operations, especially for entire I/O streams and files, for Java5 and 6.
    • Hash (Hashing): A finer hash than object.hashcode (), including the Bron filter.
    • Event Bus (Eventbus): Two communication between components, but does not require that these components explicitly register with each other
    • Math tool (Math): Optimized, thoroughly tested math tools, not provided by JDK
    • Reflection (Reflection): Guava provides tools for the reflection capabilities of Java
    • Hint: Use guava to achieve what your program wants to do
      • Guava's Philosophy (philosophy): What guava is, what guava is, what we aim for.
      • uses guava (using guava in your build) for your build, including Maven, Gradle, and other build tools
      • use professional protection (using proguard ) to avoid Your jar is bound to the part you don't use in guava.
      • equivalent to Apache Common (Apache Commons equivalents) to help you move your code from a collection of Apache common to guava
      • compatibility (compatibility) , the difference between the different versions of guava
      • abandoned pips (Idea graveyard), the request of some rejected new features
      • partner (Friends), our favorite and admired Open source project
      • how to contribute ( Howtocontribute), how to contribute to guava

Guava Introduction to guava document translation

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.