https://github.com/google/guava Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} google / guava Public * Notifications * Fork 10.8k * Star 48.6k Google core libraries for Java License Apache-2.0 license 48.6k stars 10.8k forks Activity Star Notifications * Code * Issues 636 * Pull requests 90 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights google/guava This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 25 branches 103 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/g] Use Git or checkout with SVN using the web URL. [gh repo clone google] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @cpovirk cpovirk and Google Java Core Libraries Remove stray public keyword. ... b81cf39 Nov 8, 2023 Remove stray `public` keyword. I think it's harmless, too, but I have been wrong about such things before (e.g., b/304502608) :) RELNOTES=n/a PiperOrigin-RevId: 580668074 b81cf39 Git stats * 6,240 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github Bump github/codeql-action from 2.22.4 to 2.22.5 October 28, 2023 09:55 .mvn/wrapper Add Maven wrapper distribution checksum October 26, 2023 07:16 android Remove stray public keyword. November 8, 2023 14:56 futures Copy sonatype-oss-release configuration from Guava to failureaccess. October 16, 2023 19:24 guava-bom Fix relativePath warning for guava-bom. December 10, 2020 10:48 guava-gwt Make the J2CL version of Doubles/Floats/Ints/ShortsMethodsForWeb type... October 25, 2023 17:50 guava-testlib Document why EqualsTester.addEqualityGroup has a @Nullable parame... October 31, 2023 12:11 guava-tests Prepare to make ImmutableMultimap collectors available in guava-and... October 31, 2023 09:03 guava Remove stray public keyword. November 8, 2023 14:56 integration-tests/gradle Upgrade to use Gradle 8.4 October 31, 2023 12:07 proguard Publish Proguard configs as part of Guava. May 8, 2023 17:29 refactorings This change suppresses DefaultPackage check for any java class which ... April 20, 2020 14:51 util Begin using Maven Wrapper. October 16, 2023 13:48 .gitattributes Add a .gitattributes file to control line ending normalization, which... November 4, 2014 16:50 .gitignore Add .mvn/wrapper/maven-wrapper.jar to .gitignore. October 17, 2023 09:57 CONTRIBUTING.md Fix typo: Serial number 3 -> 4 September 5, 2023 07:21 CONTRIBUTORS fix indentation April 14, 2011 12:11 LICENSE Rename COPYING to LICENSE February 22, 2023 10:59 README.md Link to some discussion of the Android flavor. November 6, 2023 10:32 cycle_suppress_list.txt Internal change December 16, 2020 14:54 javadoc-stylesheet.css Fix a couple of issues with JDK7 javadoc style by using a slightly cu... July 17, 2013 17:01 mvnw Begin using Maven Wrapper. October 16, 2023 13:48 mvnw.cmd Begin using Maven Wrapper. October 16, 2023 13:48 overview.html Fix timestamp and comments. July 17, 2023 09:01 pom.xml Simplify our maven-javadoc-plugin configuration, and move both it a... October 11, 2023 09:14 View code Guava: Google Core Libraries for Java Adding Guava to your build Snapshots and Documentation Learn about Guava Links IMPORTANT WARNINGS README.md Guava: Google Core Libraries for Java Latest release Build Status OpenSSF Best Practices Guava is a set of core Java libraries from Google that includes new collection types (such as multimap and multiset), immutable collections, a graph library, and utilities for concurrency, I/O, hashing, primitives, strings, and more! It is widely used on most Java projects within Google, and widely used by many other companies as well. Guava comes in two flavors: * The JRE flavor requires JDK 1.8 or higher. * If you need support for Android, use the Android flavor. You can find the Android Guava source in the android directory. Adding Guava to your build Guava's Maven group ID is com.google.guava, and its artifact ID is guava. Guava provides two different "flavors": one for use on a (Java 8+) JRE and one for use on Android or by any library that wants to be compatible with Android. These flavors are specified in the Maven version field as either 32.1.3-jre or 32.1.3-android. For more about depending on Guava, see using Guava in your build. To add a dependency on Guava using Maven, use the following: com.google.guava guava 32.1.3-jre 32.1.3-android To add a dependency using Gradle: dependencies { // Pick one: // 1. Use Guava in your implementation only: implementation("com.google.guava:guava:32.1.3-jre") // 2. Use Guava types in your public API: api("com.google.guava:guava:32.1.3-jre") // 3. Android - Use Guava in your implementation only: implementation("com.google.guava:guava:32.1.3-android") // 4. Android - Use Guava types in your public API: api("com.google.guava:guava:32.1.3-android") } For more information on when to use api and when to use implementation, consult the Gradle documentation on API and implementation separation. Snapshots and Documentation Snapshots of Guava built from the master branch are available through Maven using version HEAD-jre-SNAPSHOT, or HEAD-android-SNAPSHOT for the Android flavor. * Snapshot API Docs: guava * Snapshot API Diffs: guava Learn about Guava * Our users' guide, Guava Explained * A nice collection of other helpful links Links * GitHub project * Issue tracker: Report a defect or feature request * StackOverflow: Ask "how-to" and "why-didn't-it-work" questions * guava-announce: Announcements of releases and upcoming significant changes * guava-discuss: For open-ended questions and discussion IMPORTANT WARNINGS 1. APIs marked with the @Beta annotation at the class or method level are subject to change. They can be modified in any way, or even removed, at any time. If your code is a library itself (i.e., it is used on the CLASSPATH of users outside your own control), you should not use beta APIs unless you repackage them. If your code is a library, we strongly recommend using the Guava Beta Checker to ensure that you do not use any @Beta APIs! 2. APIs without @Beta will remain binary-compatible for the indefinite future. (Previously, we sometimes removed such APIs after a deprecation period. The last release to remove non-@Beta APIs was Guava 21.0.) Even @Deprecated APIs will remain (again, unless they are @Beta). We have no plans to start removing things again, but officially, we're leaving our options open in case of surprises (like, say, a serious security problem). 3. Guava has one dependency that is needed for linkage at runtime: com.google.guava:failureaccess:1.0.2. It also has some annotation-only dependencies, which we discuss in more detail at that link. 4. Serialized forms of ALL objects are subject to change unless noted otherwise. Do not persist these and assume they can be read by a future version of the library. 5. Our classes are not designed to protect against a malicious caller. You should not use them for communication between trusted and untrusted code. 6. For the mainline flavor, we test the libraries using OpenJDK 8, 11, and 17 on Linux, with some additional testing on newer JDKs and on Windows. Some features, especially in com.google.common.io, may not work correctly in non-Linux environments. For the Android flavor, our unit tests also run on API level 15 (Ice Cream Sandwich). About Google core libraries for Java Topics java guava Resources Readme License Apache-2.0 license Code of conduct Code of conduct Security policy Security policy Activity Stars 48.6k stars Watchers 2.4k watching Forks 10.8k forks Report repository Releases 41 32.1.3 Latest Oct 10, 2023 + 40 releases Packages 0 No packages published Used by 342k * @sahargholami1992 * @jdugan1024 * @Azure * @dongweizhao * @relaxcg * @Azure * @raymondFU-EAT * @LXD-DayDayUp + 342,270 Contributors 297 * @cpovirk * @cgdecker * @copybara-service[bot] * @kluever * @lowasser * @Bezier89 * @cgruber * @java-team-github-bot * @kevinb9n * @nymanjens * @lukesandberg + 286 contributors Languages * Java 100.0% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.