Package com.google.common.base


@CheckReturnValue @NullMarked package com.google.common.base
Basic utility libraries and interfaces.

This package is a part of the open-source Guava library.

Contents

The classes in this package that are most commonly useful are:

String utilities

Function types

Other

The rest

This package also contains some classes with niche use cases (e.g., Utf8 and Defaults), as well as a number of classes that have been superseded by additions to the JDK.
  • Class
    Description
    Static methods pertaining to ASCII characters (those in the range of values 0x00 through 0x7F), and to strings containing such characters.
    Utility class for converting between various ASCII case formats.
    Determines a true or false value for any Java char value, just as Predicate does for any Object.
    Contains constant definitions for the six standard Charset instances, which are guaranteed to be supported by all Java platform implementations.
    A function from A to B with an associated reverse function from B to A; used for converting back and forth between different representations of the same information.
    This class provides default values for all Java types, as defined by the JLS.
    Utility methods for working with Enum instances.
    A strategy for determining whether two instances are considered equivalent, and for computing hash codes in a manner consistent with that equivalence.
    Phantom reference with a finalizeReferent() method which a background thread invokes after the garbage collector reclaims the referent.
    Implemented by references that have code to run after garbage collection of their referents.
    A reference queue with an associated background thread that dequeues references and invokes FinalizableReference.finalizeReferent() on them.
    Soft reference with a finalizeReferent() method which a background thread invokes after the garbage collector reclaims the referent.
    Weak reference with a finalizeReferent() method which a background thread invokes after the garbage collector reclaims the referent.
    Determines an output value based on an input value; a pre-Java-8 version of java.util.function.Function.
    Static utility methods pertaining to com.google.common.base.Function instances; see that class for information about migrating to java.util.function.
    An object which joins pieces of text (specified as an array, Iterable, varargs or even a Map) with a separator.
    An object that joins map entries in the same manner as Joiner joins iterables and arrays.
    Helper functions that operate on any Object, and are not already provided in Objects.
    Helper functions that can operate on any Object.
    An immutable object that may contain a non-null reference to another object.
    Static convenience methods that help a method or constructor check whether it was invoked correctly (that is, whether its preconditions were met).
    Determines a true or false value for a given input; a pre-Java-8 version of java.util.function.Predicate.
    Static utility methods pertaining to Predicate instances.
    Extracts non-overlapping substrings from an input string, typically by recognizing appearances of a separator sequence.
    An object that splits strings into maps as Splitter splits iterables and lists.
    An object that accurately measures elapsed time: the measured duration between two successive readings of "now" in the same process.
    Static utility methods pertaining to String or CharSequence instances.
    A class that can supply objects of a single type; a pre-Java-8 version of java.util.function.Supplier.
    Useful suppliers.
    Static utility methods pertaining to instances of Throwable.
    A time source; returns a time value representing the number of nanoseconds elapsed since some fixed but arbitrary point in time.
    Low-level, high-performance utility methods related to the UTF-8 character encoding.
    Static convenience methods that serve the same purpose as Java language assertions, except that they are always enabled.
    Exception thrown upon the failure of a verification check, including those performed by the convenience methods of the Verify class.