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.
- 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