| Package | Description | 
|---|---|
| com.google.common.base | Basic utility libraries and interfaces. | 
| com.google.common.cache | This package contains caching utilities. | 
| com.google.common.collect | This package contains generic collection interfaces and implementations, and other utilities for
 working with collections. | 
| com.google.common.io | This package contains utility methods and classes for working with Java I/O; for example input
 streams, output streams, readers, writers, and files. | 
| com.google.common.math | Arithmetic functions operating on primitive values and  BigIntegerinstances. | 
| com.google.common.net | This package contains utility methods and classes for working with net addresses (numeric IP and
 domain names). | 
| com.google.common.primitives | Static utilities for working with the eight primitive types and  void, and value types for
 treating them as unsigned. | 
| com.google.common.util.concurrent | Concurrency utilities. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | DefaultsThis class provides default values for all Java types, as defined by the JLS. | 
| class  | FinalizablePhantomReference<T>Phantom reference with a  finalizeReferent()method which a background thread invokes
 after the garbage collector reclaims the referent. | 
| interface  | FinalizableReferenceImplemented by references that have code to run after garbage collection of their referents. | 
| class  | FinalizableReferenceQueueA reference queue with an associated background thread that dequeues references and invokes
  FinalizableReference.finalizeReferent()on them. | 
| class  | FinalizableSoftReference<T>Soft reference with a  finalizeReferent()method which a background thread invokes after
 the garbage collector reclaims the referent. | 
| class  | FinalizableWeakReference<T>Weak reference with a  finalizeReferent()method which a background thread invokes after
 the garbage collector reclaims the referent. | 
| class  | StandardSystemPropertyRepresents a standard system property. | 
| Modifier and Type | Field and Description | 
|---|---|
| static Charset | Charsets. US_ASCIIUS-ASCII: seven-bit ASCII, the Basic Latin block of the Unicode character set (ISO646-US). | 
| static Charset | Charsets. UTF_16UTF-16: sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order
 mark. | 
| static Charset | Charsets. UTF_16BEUTF-16BE: sixteen-bit UCS Transformation Format, big-endian byte order. | 
| static Charset | Charsets. UTF_16LEUTF-16LE: sixteen-bit UCS Transformation Format, little-endian byte order. | 
| Modifier and Type | Method and Description | 
|---|---|
| static Predicate<CharSequence> | Predicates. contains(Pattern pattern)Returns a predicate that evaluates to  trueif theCharSequencebeing tested
 contains any match for the given regular expression pattern. | 
| static Predicate<CharSequence> | Predicates. containsPattern(String pattern)Returns a predicate that evaluates to  trueif theCharSequencebeing tested
 contains any match for the given regular expression pattern. | 
| Duration | Stopwatch. elapsed()Returns the current elapsed time shown on this stopwatch as a  Duration. | 
| static <X extends Throwable> | Throwables. getCauseAs(Throwable throwable,
          Class<X> expectedCauseType)Returns  throwable's cause, cast toexpectedCauseType. | 
| static Field | Enums. getField(Enum<?> enumValue)Returns the  Fieldin whichenumValueis defined. | 
| static String | Throwables. getStackTraceAsString(Throwable throwable)Returns a string containing the result of  toString(), followed by
 the full, recursive stack trace ofthrowable. | 
| static Predicate<Object> | Predicates. instanceOf(Class<?> clazz)Returns a predicate that evaluates to  trueif the object being tested is an instance of
 the given class. | 
| static List<StackTraceElement> | Throwables. lazyStackTrace(Throwable throwable)Returns the stack trace of  throwable, possibly providing slower iteration over the full
 trace but faster iteration over parts of the trace. | 
| static boolean | Throwables. lazyStackTraceIsLazy()Returns whether  Throwables.lazyStackTrace(java.lang.Throwable)will use the special implementation described in its
 documentation. | 
| static Splitter | Splitter. on(Pattern separatorPattern)Returns a splitter that considers any subsequence matching  patternto be a separator. | 
| static Splitter | Splitter. onPattern(String separatorPattern)Returns a splitter that considers any subsequence matching a given pattern (regular expression)
 to be a separator. | 
| static RuntimeException | Throwables. propagate(Throwable throwable)Deprecated. 
 Use  throw eorthrow new RuntimeException(e)directly, or use a
     combination ofThrowables.throwIfUnchecked(java.lang.Throwable)andthrow new RuntimeException(e). For
     background on the deprecation, read Why we deprecatedThrowables.propagate. | 
| static <X extends Throwable> | Throwables. propagateIfInstanceOf(@Nullable Throwable throwable,
                     Class<X> declaredType)Deprecated. 
 Use  Throwables.throwIfInstanceOf(java.lang.Throwable, java.lang.Class<X>), which has the same behavior but rejectsnull. | 
| static void | Throwables. propagateIfPossible(@Nullable Throwable throwable)Deprecated. 
 Use  Throwables.throwIfUnchecked(java.lang.Throwable), which has the same behavior but rejectsnull. | 
| static <X extends Throwable> | Throwables. propagateIfPossible(@Nullable Throwable throwable,
                   Class<X> declaredType)Propagates  throwableexactly as-is, if and only if it is an instance ofRuntimeException,Error, ordeclaredType. | 
| static <X1 extends Throwable,X2 extends Throwable> | Throwables. propagateIfPossible(@Nullable Throwable throwable,
                   Class<X1> declaredType1,
                   Class<X2> declaredType2)Propagates  throwableexactly as-is, if and only if it is an instance ofRuntimeException,Error,declaredType1, ordeclaredType2. | 
| static Predicate<Class<?>> | Predicates. subtypeOf(Class<?> clazz)Returns a predicate that evaluates to  trueif the class being tested is assignable to
 (is a subtype of)clazz. | 
| static <X extends Throwable> | Throwables. throwIfInstanceOf(Throwable throwable,
                 Class<X> declaredType)Throws  throwableif it is an instance ofdeclaredType. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | AbstractLoadingCache<K,V>This class provides a skeletal implementation of the  Cacheinterface to minimize the
 effort required to implement this interface. | 
| class  | CacheBuilderSpecA specification of a  CacheBuilderconfiguration. | 
| class  | ForwardingCache<K,V>A cache which forwards all its method calls to another cache. | 
| class  | ForwardingLoadingCache<K,V>A cache which forwards all its method calls to another cache. | 
| class  | RemovalListenersA collection of common removal listeners. | 
| Modifier and Type | Method and Description | 
|---|---|
| static <K,V> CacheLoader<K,V> | CacheLoader. asyncReloading(CacheLoader<K,V> loader,
              Executor executor)Returns a  CacheLoaderwhich wrapsloader, executing calls toCacheLoader.reload(K, V)usingexecutor. | 
| CacheBuilder<K,V> | CacheBuilder. expireAfterAccess(Duration duration)Specifies that each entry should be automatically removed from the cache once a fixed duration
 has elapsed after the entry's creation, the most recent replacement of its value, or its last
 access. | 
| CacheBuilder<K,V> | CacheBuilder. expireAfterWrite(Duration duration)Specifies that each entry should be automatically removed from the cache once a fixed duration
 has elapsed after the entry's creation, or the most recent replacement of its value. | 
| static CacheBuilder<Object,Object> | CacheBuilder. from(CacheBuilderSpec spec)Constructs a new  CacheBuilderinstance with the settings specified inspec. | 
| static CacheBuilder<Object,Object> | CacheBuilder. from(String spec)Constructs a new  CacheBuilderinstance with the settings specified inspec. | 
| CacheBuilder<K,V> | CacheBuilder. maximumWeight(long maximumWeight)Specifies the maximum weight of entries the cache may contain. | 
| CacheBuilder<K,V> | CacheBuilder. refreshAfterWrite(Duration duration)Specifies that active entries are eligible for automatic refresh once a fixed duration has
 elapsed after the entry's creation, or the most recent replacement of its value. | 
| CacheBuilder<K,V> | CacheBuilder. refreshAfterWrite(long duration,
                 TimeUnit unit)Specifies that active entries are eligible for automatic refresh once a fixed duration has
 elapsed after the entry's creation, or the most recent replacement of its value. | 
| ListenableFuture<V> | CacheLoader. reload(K key,
      V oldValue)Computes or retrieves a replacement value corresponding to an already-cached  key. | 
| CacheBuilder<K,V> | CacheBuilder. softValues()Specifies that each value (not key) stored in the cache should be wrapped in a  SoftReference(by default, strong references are used). | 
| CacheBuilder<K,V> | CacheBuilder. weakKeys()Specifies that each key (not value) stored in the cache should be wrapped in a  WeakReference(by default, strong references are used). | 
| CacheBuilder<K,V> | CacheBuilder. weakValues()Specifies that each value (not key) stored in the cache should be wrapped in a  WeakReference(by default, strong references are used). | 
| <K1 extends K,V1 extends V> | CacheBuilder. weigher(Weigher<? super K1,? super V1> weigher)Specifies the weigher to use in determining the weight of entries. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | ConcurrentHashMultiset<E>A multiset that supports concurrent modifications and that provides atomic versions of most
  Multisetoperations (exceptions where noted). | 
| class  | ForwardingBlockingDeque<E>Deprecated. 
 This class has moved to  com.google.common.util.concurrent. Please useForwardingBlockingDequeinstead. | 
| class  | ForwardingDeque<E>A deque which forwards all its method calls to another deque. | 
| class  | ForwardingNavigableMap<K,V>A navigable map which forwards all its method calls to another navigable map. | 
| class  | ForwardingNavigableSet<E>A navigable set which forwards all its method calls to another navigable set. | 
| class  | ImmutableClassToInstanceMap<B>A  ClassToInstanceMapwhose contents will never change, with many other important
 properties detailed atImmutableCollection. | 
| class  | ImmutableRangeMap<K extends Comparable<?>,V>A  RangeMapwhose contents will never change, with many other important properties
 detailed atImmutableCollection. | 
| class  | ImmutableRangeSet<C extends Comparable>A  RangeSetwhose contents will never change, with many other important properties
 detailed atImmutableCollection. | 
| class  | ImmutableSortedMultiset<E>A  SortedMultisetwhose contents will never change, with many other important properties
 detailed atImmutableCollection. | 
| interface  | Interner<E>Provides equivalent behavior to  String.intern()for other immutable types. | 
| class  | InternersContains static methods pertaining to instances of  Interner. | 
| class  | MutableClassToInstanceMap<B>A mutable class-to-instance map backed by an arbitrary user-provided map. | 
| interface  | RangeMap<K extends Comparable,V>A mapping from disjoint nonempty ranges to non-null values. | 
| interface  | RangeSet<C extends Comparable> | 
| class  | TreeRangeMap<K extends Comparable,V>An implementation of  RangeMapbased on aTreeMap, supporting all optional
 operations. | 
| class  | TreeRangeSet<C extends Comparable<?>> | 
| Modifier and Type | Method and Description | 
|---|---|
| static <K,V> NavigableMap<K,V> | Maps. asMap(NavigableSet<K> set,
     Function<? super K,V> function)Returns a view of the navigable set as a map, mapping keys from the set according to the
 specified function. | 
| E | ImmutableSortedSet. ceiling(E e) | 
| static <T> T[] | ObjectArrays. concat(T[] first,
      T[] second,
      Class<T> type)Returns a new array that contains the concatenated contents of two arrays. | 
| abstract UnmodifiableIterator<E> | ImmutableSortedSet. descendingIterator() | 
| ImmutableSortedSet<E> | ImmutableSortedSet. descendingSet() | 
| static <E> int | Queues. drain(BlockingQueue<E> q,
     Collection<? super E> buffer,
     int numElements,
     Duration timeout)Drains the queue as  BlockingQueue.drainTo(Collection, int), but if the requestednumElementselements are not available, it will wait for them up to the specified timeout. | 
| static <E> int | Queues. drain(BlockingQueue<E> q,
     Collection<? super E> buffer,
     int numElements,
     long timeout,
     TimeUnit unit)Drains the queue as  BlockingQueue.drainTo(Collection, int), but if the requestednumElementselements are not available, it will wait for them up to the specified timeout. | 
| static <E> int | Queues. drainUninterruptibly(BlockingQueue<E> q,
                    Collection<? super E> buffer,
                    int numElements,
                    Duration timeout)Drains the queue as Queues.drain(BlockingQueue, Collection, int, Duration), but with a
 different behavior in case it is interrupted while waiting. | 
| static <E> int | Queues. drainUninterruptibly(BlockingQueue<E> q,
                    Collection<? super E> buffer,
                    int numElements,
                    long timeout,
                    TimeUnit unit)Drains the queue as Queues.drain(BlockingQueue, Collection, int, long, TimeUnit), but
 with a different behavior in case it is interrupted while waiting. | 
| <T> FluentIterable<T> | FluentIterable. filter(Class<T> type)Returns the elements from this fluent iterable that are instances of class  type. | 
| static <T> Iterable<T> | Iterables. filter(Iterable<?> unfiltered,
      Class<T> desiredType)Returns a view of  unfilteredcontaining all elements that are of the typedesiredType. | 
| static <T> UnmodifiableIterator<T> | Iterators. filter(Iterator<?> unfiltered,
      Class<T> desiredType)Returns a view of  unfilteredcontaining all elements that are of the typedesiredType. | 
| static <E> NavigableSet<E> | Sets. filter(NavigableSet<E> unfiltered,
      Predicate<? super E> predicate)Returns the elements of a  NavigableSet,unfiltered, that satisfy a predicate. | 
| static <K,V> NavigableMap<K,V> | Maps. filterEntries(NavigableMap<K,V> unfiltered,
             Predicate<? super Map.Entry<K,V>> entryPredicate)Returns a sorted map containing the mappings in  unfilteredthat satisfy a predicate. | 
| static <K,V> NavigableMap<K,V> | Maps. filterKeys(NavigableMap<K,V> unfiltered,
          Predicate<? super K> keyPredicate)Returns a navigable map containing the mappings in  unfilteredwhose keys satisfy a
 predicate. | 
| static <K,V> NavigableMap<K,V> | Maps. filterValues(NavigableMap<K,V> unfiltered,
            Predicate<? super V> valuePredicate)Returns a navigable map containing the mappings in  unfilteredwhose values satisfy a
 predicate. | 
| E | ImmutableSortedSet. floor(E e) | 
| static ImmutableMap<String,String> | Maps. fromProperties(Properties properties)Creates an  ImmutableMap<String, String>from aPropertiesinstance. | 
| NavigableSet<V> | TreeMultimap. get(K key) | 
| ContiguousSet<C> | ContiguousSet. headSet(C toElement,
       boolean inclusive) | 
| ImmutableSortedSet<E> | ImmutableSortedSet. headSet(E toElement,
       boolean inclusive) | 
| E | ImmutableSortedSet. higher(E e) | 
| E | ImmutableSortedSet. lower(E e) | 
| static <T> T[] | ObjectArrays. newArray(Class<T> type,
        int length)Returns a new array of the given length with the specified component type. | 
| static <E> ArrayBlockingQueue<E> | Queues. newArrayBlockingQueue(int capacity)Creates an empty  ArrayBlockingQueuewith the given (fixed) capacity and nonfair access
 policy. | 
| static <E> ConcurrentLinkedQueue<E> | Queues. newConcurrentLinkedQueue()Creates an empty  ConcurrentLinkedQueue. | 
| static <E> ConcurrentLinkedQueue<E> | Queues. newConcurrentLinkedQueue(Iterable<? extends E> elements)Creates a  ConcurrentLinkedQueuecontaining the elements of the specified iterable, in
 the order they are returned by the iterable's iterator. | 
| static <E> CopyOnWriteArrayList<E> | Lists. newCopyOnWriteArrayList()Creates an empty  CopyOnWriteArrayListinstance. | 
| static <E> CopyOnWriteArrayList<E> | Lists. newCopyOnWriteArrayList(Iterable<? extends E> elements)Creates a  CopyOnWriteArrayListinstance containing the given elements. | 
| static <E> CopyOnWriteArraySet<E> | Sets. newCopyOnWriteArraySet()Creates an empty  CopyOnWriteArraySetinstance. | 
| static <E> CopyOnWriteArraySet<E> | Sets. newCopyOnWriteArraySet(Iterable<? extends E> elements)Creates a  CopyOnWriteArraySetinstance containing the given elements. | 
| static <E> LinkedBlockingDeque<E> | Queues. newLinkedBlockingDeque()Creates an empty  LinkedBlockingDequewith a capacity ofInteger.MAX_VALUE. | 
| static <E> LinkedBlockingDeque<E> | Queues. newLinkedBlockingDeque(int capacity)Creates an empty  LinkedBlockingDequewith the given (fixed) capacity. | 
| static <E> LinkedBlockingDeque<E> | Queues. newLinkedBlockingDeque(Iterable<? extends E> elements)Creates a  LinkedBlockingDequewith a capacity ofInteger.MAX_VALUE, containing
 the elements of the specified iterable, in the order they are returned by the iterable's
 iterator. | 
| static <E> LinkedBlockingQueue<E> | Queues. newLinkedBlockingQueue()Creates an empty  LinkedBlockingQueuewith a capacity ofInteger.MAX_VALUE. | 
| static <E> LinkedBlockingQueue<E> | Queues. newLinkedBlockingQueue(int capacity)Creates an empty  LinkedBlockingQueuewith the given (fixed) capacity. | 
| static <E> LinkedBlockingQueue<E> | Queues. newLinkedBlockingQueue(Iterable<? extends E> elements)Creates a  LinkedBlockingQueuewith a capacity ofInteger.MAX_VALUE, containing
 the elements of the specified iterable, in the order they are returned by the iterable's
 iterator. | 
| static <E extends Comparable> | Queues. newPriorityBlockingQueue()Creates an empty  PriorityBlockingQueuewith the ordering given by its elements' natural
 ordering. | 
| static <E extends Comparable> | Queues. newPriorityBlockingQueue(Iterable<? extends E> elements)Creates a  PriorityBlockingQueuecontaining the given elements. | 
| static <E> SynchronousQueue<E> | Queues. newSynchronousQueue()Creates an empty  SynchronousQueuewith nonfair access policy. | 
| static <E> Interner<E> | Interners. newWeakInterner()Returns a new thread-safe interner which retains a weak reference to each instance it has
 interned, and so does not prevent these instances from being garbage-collected. | 
| E | ImmutableSortedSet. pollFirst()Deprecated. 
 Unsupported operation. | 
| E | ImmutableSortedSet. pollLast()Deprecated. 
 Unsupported operation. | 
| static <K extends Comparable<? super K>,V> | Maps. subMap(NavigableMap<K,V> map,
      Range<K> range)Returns a view of the portion of  mapwhose keys are contained byrange. | 
| ContiguousSet<C> | ContiguousSet. subSet(C fromElement,
      boolean fromInclusive,
      C toElement,
      boolean toInclusive) | 
| ImmutableSortedSet<E> | ImmutableSortedSet. subSet(E fromElement,
      boolean fromInclusive,
      E toElement,
      boolean toInclusive) | 
| static <K extends Comparable<? super K>> | Sets. subSet(NavigableSet<K> set,
      Range<K> range)Returns a view of the portion of  setwhose elements are contained byrange. | 
| static <K,V> NavigableMap<K,V> | Maps. synchronizedNavigableMap(NavigableMap<K,V> navigableMap)Returns a synchronized (thread-safe) navigable map backed by the specified navigable map. | 
| static <E> NavigableSet<E> | Sets. synchronizedNavigableSet(NavigableSet<E> navigableSet)Returns a synchronized (thread-safe) navigable set backed by the specified navigable set. | 
| ContiguousSet<C> | ContiguousSet. tailSet(C fromElement,
       boolean inclusive) | 
| ImmutableSortedSet<E> | ImmutableSortedSet. tailSet(E fromElement,
       boolean inclusive) | 
| E[] | FluentIterable. toArray(Class<E> type)Returns an array containing all of the elements from this fluent iterable in iteration order. | 
| V[][] | ArrayTable. toArray(Class<V> valueClass)Returns a two-dimensional array with the table contents. | 
| static <T> T[] | Iterables. toArray(Iterable<? extends T> iterable,
       Class<T> type)Copies an iterable's elements into an array. | 
| static <T> T[] | Iterators. toArray(Iterator<? extends T> iterator,
       Class<T> type)Copies an iterator's elements into an array. | 
| static <K,V1,V2> NavigableMap<K,V2> | Maps. transformEntries(NavigableMap<K,V1> fromMap,
                Maps.EntryTransformer<? super K,? super V1,V2> transformer)Returns a view of a navigable map whose values are derived from the original navigable map's
 entries. | 
| static <K,V1,V2> NavigableMap<K,V2> | Maps. transformValues(NavigableMap<K,V1> fromMap,
               Function<? super V1,V2> function)Returns a view of a navigable map where each value is transformed by a function. | 
| static <K,V> NavigableMap<K,V> | Maps. unmodifiableNavigableMap(NavigableMap<K,? extends V> map)Returns an unmodifiable view of the specified navigable map. | 
| Interners.InternerBuilder | Interners.InternerBuilder. weak()Instructs the  Interners.InternerBuilderto build a weak interner. | 
| MapMaker | MapMaker. weakKeys()Specifies that each key (not value) stored in the map should be wrapped in a  WeakReference(by default, strong references are used). | 
| MapMaker | MapMaker. weakValues()Specifies that each value (not key) stored in the map should be wrapped in a  WeakReference(by default, strong references are used). | 
| Modifier and Type | Interface and Description | 
|---|---|
| interface  | ByteArrayDataInputAn extension of  DataInputfor reading from in-memory byte arrays; its methods offer
 identical functionality but do not throwIOException. | 
| interface  | ByteArrayDataOutputAn extension of  DataOutputfor writing to in-memory byte arrays; its methods offer
 identical functionality but do not throwIOException. | 
| interface  | ByteProcessor<T>A callback interface to process bytes from a stream. | 
| class  | ByteSinkA destination to which bytes can be written, such as a file. | 
| class  | ByteSourceA readable source of bytes, such as a file. | 
| class  | ByteStreamsProvides utility methods for working with byte arrays and I/O streams. | 
| class  | CharSinkA destination to which characters can be written, such as a text file. | 
| class  | CharSourceA readable source of characters, such as a text file. | 
| class  | CharStreamsProvides utility methods for working with character streams. | 
| class  | CloseablesUtility methods for working with  Closeableobjects. | 
| class  | Closer | 
| class  | CountingInputStreamAn  InputStreamthat counts the number of bytes read. | 
| class  | CountingOutputStreamAn OutputStream that counts the number of bytes written. | 
| class  | FileBackedOutputStreamAn  OutputStreamthat starts buffering to a byte array, but switches to file buffering
 once the data reaches a configurable size. | 
| class  | FilesProvides utility methods for working with files. | 
| class  | FileWriteModeModes for opening a file for writing. | 
| class  | FlushablesUtility methods for working with  Flushableobjects. | 
| class  | InsecureRecursiveDeleteExceptionException indicating that a recursive delete can't be performed because the file system does not
 have the support necessary to guarantee that it is not vulnerable to race conditions that would
 allow it to delete files and directories outside of the directory being deleted (i.e.,  SecureDirectoryStreamis not supported). | 
| interface  | LineProcessor<T>A callback to be used with the streaming  readLinesmethods. | 
| class  | LineReaderA class for reading lines of text. | 
| class  | LittleEndianDataInputStreamAn implementation of  DataInputthat uses little-endian byte ordering for readingshort,int,float,double, andlongvalues. | 
| class  | LittleEndianDataOutputStreamAn implementation of  DataOutputthat uses little-endian byte ordering for writingchar,short,int,float,double, andlongvalues. | 
| class  | MoreFiles | 
| class  | PatternFilenameFilterFile name filter that only accepts files matching a regular expression. | 
| class  | RecursiveDeleteOptionOptions for use with recursive delete methods ( MoreFiles.deleteRecursively(java.nio.file.Path, com.google.common.io.RecursiveDeleteOption...)andMoreFiles.deleteDirectoryContents(java.nio.file.Path, com.google.common.io.RecursiveDeleteOption...)). | 
| class  | ResourcesProvides utility methods for working with resources in the classpath. | 
| Modifier and Type | Method and Description | 
|---|---|
| ByteSource | BaseEncoding. decodingSource(CharSource encodedSource)Returns a  ByteSourcethat reads base-encoded bytes from the specifiedCharSource. | 
| abstract InputStream | BaseEncoding. decodingStream(Reader reader)Returns an  InputStreamthat decodes base-encoded input from the specifiedReader. | 
| ByteSink | BaseEncoding. encodingSink(CharSink encodedSink)Returns a  ByteSinkthat writes base-encoded bytes to the specifiedCharSink. | 
| abstract OutputStream | BaseEncoding. encodingStream(Writer writer)Returns an  OutputStreamthat encodes bytes using this encoding into the specifiedWriter. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | LinearTransformationThe representation of a linear transformation between real numbers  xandy. | 
| class  | PairedStatsAn immutable value object capturing some basic statistics about a collection of paired double
 values (e.g. | 
| class  | PairedStatsAccumulatorA mutable object which accumulates paired double values (e.g. | 
| class  | QuantilesProvides a fluent API for calculating quantiles. | 
| class  | StatsA bundle of statistical summary values -- sum, count, mean/average, min and max, and several
 forms of variance -- that were computed from a single set of zero or more floating-point values. | 
| class  | StatsAccumulatorA mutable object which accumulates double values and tracks some basic statistics over all the
 values added so far. | 
| Modifier and Type | Method and Description | 
|---|---|
| static long | LongMath. checkedAdd(long a,
          long b)Returns the sum of  aandb, provided it does not overflow. | 
| static long | LongMath. checkedPow(long b,
          int k)Returns the  bto thekth power, provided it does not overflow. | 
| static long | LongMath. checkedSubtract(long a,
               long b)Returns the difference of  aandb, provided it does not overflow. | 
| static BigInteger | BigIntegerMath. divide(BigInteger p,
      BigInteger q,
      RoundingMode mode)Returns the result of dividing  pbyq, rounding using the specifiedRoundingMode. | 
| static long | LongMath. divide(long p,
      long q,
      RoundingMode mode)Returns the result of dividing  pbyq, rounding using the specifiedRoundingMode. | 
| static long | LongMath. factorial(int n)Returns  n!, that is, the product of the firstnpositive integers,1ifn == 0, orLong.MAX_VALUEif the result does not fit in along. | 
| static boolean | DoubleMath. isMathematicalInteger(double x)Returns  trueifxrepresents a mathematical integer. | 
| static boolean | DoubleMath. isPowerOfTwo(double x)Returns  trueifxis exactly equal to2^kfor some finite integerk. | 
| static boolean | IntMath. isPrime(int n)Returns  trueifnis a prime number: an integer greater
 than one that cannot be factored into a product of smaller positive integers. | 
| static boolean | LongMath. isPrime(long n)Returns  trueifnis a prime number: an integer greater
 than one that cannot be factored into a product of smaller positive integers. | 
| static int | BigIntegerMath. log10(BigInteger x,
     RoundingMode mode)Returns the base-10 logarithm of  x, rounded according to the specified rounding mode. | 
| static int | IntMath. log10(int x,
     RoundingMode mode)Returns the base-10 logarithm of  x, rounded according to the specified rounding mode. | 
| static int | LongMath. log10(long x,
     RoundingMode mode)Returns the base-10 logarithm of  x, rounded according to the specified rounding mode. | 
| static int | DoubleMath. log2(double x,
    RoundingMode mode)Returns the base 2 logarithm of a double value, rounded with the specified rounding mode to an
  int. | 
| static double | DoubleMath. mean(double... values)Deprecated. 
 Use  Stats.meanOf(java.lang.Iterable<? extends java.lang.Number>)instead, noting the less strict handling of non-finite
     values. | 
| static double | DoubleMath. mean(Iterable<? extends Number> values)Deprecated. 
 Use  Stats.meanOf(java.lang.Iterable<? extends java.lang.Number>)instead, noting the less strict handling of non-finite
     values. | 
| static double | DoubleMath. mean(Iterator<? extends Number> values)Deprecated. 
 Use  Stats.meanOf(java.lang.Iterable<? extends java.lang.Number>)instead, noting the less strict handling of non-finite
     values. | 
| static int | LongMath. mod(long x,
   int m)Returns  x mod m, a non-negative value less thanm. | 
| static long | LongMath. mod(long x,
   long m)Returns  x mod m, a non-negative value less thanm. | 
| static int | IntMath. pow(int b,
   int k)Returns  bto thekth power. | 
| static long | LongMath. pow(long b,
   int k)Returns  bto thekth power. | 
| static BigInteger | DoubleMath. roundToBigInteger(double x,
                 RoundingMode mode)Returns the  BigIntegervalue that is equal toxrounded with the specified
 rounding mode, if possible. | 
| static int | DoubleMath. roundToInt(double x,
          RoundingMode mode)Returns the  intvalue that is equal toxrounded with the specified rounding
 mode, if possible. | 
| static long | DoubleMath. roundToLong(double x,
           RoundingMode mode)Returns the  longvalue that is equal toxrounded with the specified rounding
 mode, if possible. | 
| static BigInteger | BigIntegerMath. sqrt(BigInteger x,
    RoundingMode mode)Returns the square root of  x, rounded with the specified rounding mode. | 
| static int | IntMath. sqrt(int x,
    RoundingMode mode)Returns the square root of  x, rounded with the specified rounding mode. | 
| static long | LongMath. sqrt(long x,
    RoundingMode mode)Returns the square root of  x, rounded with the specified rounding mode. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | HostSpecifierA syntactically valid host specifier, suitable for use in a URI. | 
| class  | InetAddressesStatic utility methods pertaining to  InetAddressinstances. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | PrimitivesContains static utility methods pertaining to primitive types and their corresponding wrapper
 types. | 
| class  | UnsignedBytesStatic utility methods pertaining to  byteprimitives that interpret values as
 unsigned (that is, any negative valuebis treated as the positive value256 + b). | 
| Modifier and Type | Method and Description | 
|---|---|
| static char | Chars. fromByteArray(byte[] bytes)Returns the  charvalue whose big-endian representation is stored in the first 2 bytes
 ofbytes; equivalent toByteBuffer.wrap(bytes).getChar(). | 
| static short | Shorts. fromByteArray(byte[] bytes)Returns the  shortvalue whose big-endian representation is stored in the first 2 bytes
 ofbytes; equivalent toByteBuffer.wrap(bytes).getShort(). | 
| static char | Chars. fromBytes(byte b1,
         byte b2)Returns the  charvalue whose byte representation is the given 2 bytes, in big-endian
 order; equivalent toChars.fromByteArray(new byte[] {b1, b2}). | 
| static short | Shorts. fromBytes(byte b1,
         byte b2)Returns the  shortvalue whose byte representation is the given 2 bytes, in big-endian
 order; equivalent toShorts.fromByteArray(new byte[] {b1, b2}). | 
| UnsignedInteger | UnsignedInteger. times(UnsignedInteger val)Returns the result of multiplying this and  val. | 
| static byte[] | Chars. toByteArray(char value)Returns a big-endian representation of  valuein a 2-element byte array; equivalent toByteBuffer.allocate(2).putChar(value).array(). | 
| static byte[] | Shorts. toByteArray(short value)Returns a big-endian representation of  valuein a 2-element byte array; equivalent toByteBuffer.allocate(2).putShort(value).array(). | 
| static @Nullable Double | Doubles. tryParse(String string)Parses the specified string as a double-precision floating point value. | 
| static @Nullable Float | Floats. tryParse(String string)Parses the specified string as a single-precision floating point value. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | AbstractExecutionThreadServiceBase class for services that can implement  AbstractExecutionThreadService.startUp(),AbstractExecutionThreadService.run()andAbstractExecutionThreadService.shutDown()methods. | 
| class  | AbstractIdleServiceBase class for services that do not need a thread while "running" but may need one during startup
 and shutdown. | 
| class  | AbstractListeningExecutorServiceAbstract  ListeningExecutorServiceimplementation that createsListenableFutureinstances for eachRunnableandCallablesubmitted to it. | 
| class  | AbstractScheduledServiceBase class for services that can implement  AbstractScheduledService.startUp()andAbstractScheduledService.shutDown()but while in
 the "running" state need to perform a periodic task. | 
| class  | AbstractServiceBase class for implementing services that can handle  AbstractService.doStart()andAbstractService.doStop()requests, responding to them withAbstractService.notifyStarted()andAbstractService.notifyStopped()callbacks. | 
| class  | AtomicDoubleA  doublevalue that may be updated atomically. | 
| class  | AtomicDoubleArrayA  doublearray in which elements may be updated atomically. | 
| class  | AtomicsStatic utility methods pertaining to classes in the  java.util.concurrent.atomicpackage. | 
| class  | CycleDetectingLockFactoryThe  CycleDetectingLockFactorycreatesReentrantLockinstances andReentrantReadWriteLockinstances that detect potential deadlock by checking for cycles in lock
 acquisition order. | 
| class  | ExecutionListA support class for  ListenableFutureimplementations to manage their listeners. | 
| class  | FakeTimeLimiterA TimeLimiter implementation which actually does not attempt to limit time at all. | 
| class  | ForwardingBlockingDeque<E>A  BlockingDequewhich forwards all its method calls to anotherBlockingDeque. | 
| class  | ForwardingBlockingQueue<E>A  BlockingQueuewhich forwards all its method calls to anotherBlockingQueue. | 
| class  | ForwardingExecutorServiceAn executor service which forwards all its method calls to another executor service. | 
| class  | ForwardingListeningExecutorServiceA listening executor service which forwards all its method calls to another listening executor
 service. | 
| class  | JdkFutureAdaptersUtilities necessary for working with libraries that supply plain  Futureinstances. | 
| class  | ListenableFutureTask<V>A  FutureTaskthat also implements theListenableFutureinterface. | 
| interface  | ListeningExecutorServiceAn  ExecutorServicethat returnsListenableFutureinstances. | 
| interface  | ListeningScheduledExecutorServiceA  ScheduledExecutorServicethat returnsListenableFutureinstances from itsExecutorServicemethods. | 
| class  | MonitorA synchronization abstraction supporting waiting on arbitrary boolean conditions. | 
| class  | RateLimiterA rate limiter. | 
| interface  | ServiceAn object with an operational state, plus asynchronous  Service.startAsync()andService.stopAsync()lifecycle methods to transition between states. | 
| class  | ServiceManagerA manager for monitoring and controlling a set of services. | 
| class  | SimpleTimeLimiterA TimeLimiter that runs method calls in the background using an  ExecutorService. | 
| class  | Striped<L>A striped  Lock/Semaphore/ReadWriteLock. | 
| class  | ThreadFactoryBuilderA ThreadFactory builder, providing any combination of these features:
 
   whether threads should be marked as daemon threads
   a naming format
   a thread priority
   an uncaught exception handler
   a backing thread factory
  | 
| interface  | TimeLimiterImposes a time limit on method calls. | 
| class  | UncaughtExceptionHandlersFactories for  Thread.UncaughtExceptionHandlerinstances. | 
| class  | UncheckedTimeoutExceptionUnchecked version of  TimeoutException. | 
| Modifier and Type | Method and Description | 
|---|---|
| static void | MoreExecutors. addDelayedShutdownHook(ExecutorService service,
                      Duration terminationTimeout)Add a shutdown hook to wait for thread completion in the given  service. | 
| static void | MoreExecutors. addDelayedShutdownHook(ExecutorService service,
                      long terminationTimeout,
                      TimeUnit timeUnit)Add a shutdown hook to wait for thread completion in the given  service. | 
| static <T> AsyncCallable<T> | Callables. asAsyncCallable(Callable<T> callable,
               ListeningExecutorService listeningExecutorService)Creates an  AsyncCallablefrom aCallable. | 
| static boolean | Uninterruptibles. awaitUninterruptibly(Condition condition,
                    Duration timeout)Invokes  condition.await(timeout, unit)uninterruptibly. | 
| static boolean | Uninterruptibles. awaitUninterruptibly(Condition condition,
                    long timeout,
                    TimeUnit unit)Invokes  condition.await(timeout, unit)uninterruptibly. | 
| static void | Uninterruptibles. awaitUninterruptibly(CountDownLatch latch)Invokes  latch.await()uninterruptibly. | 
| static boolean | Uninterruptibles. awaitUninterruptibly(CountDownLatch latch,
                    Duration timeout)Invokes  latch.await(timeout, unit)uninterruptibly. | 
| static boolean | Uninterruptibles. awaitUninterruptibly(CountDownLatch latch,
                    long timeout,
                    TimeUnit unit)Invokes  latch.await(timeout, unit)uninterruptibly. | 
| static <V,X extends Exception> | Futures. getChecked(Future<V> future,
          Class<X> exceptionClass)Returns the result of  Future.get(), converting most exceptions to a new instance of the
 given checked exception type. | 
| static <V,X extends Exception> | Futures. getChecked(Future<V> future,
          Class<X> exceptionClass,
          Duration timeout)Returns the result of  Future.get(long, TimeUnit), converting most exceptions to a new
 instance of the given checked exception type. | 
| static <V,X extends Exception> | Futures. getChecked(Future<V> future,
          Class<X> exceptionClass,
          long timeout,
          TimeUnit unit)Returns the result of  Future.get(long, TimeUnit), converting most exceptions to a new
 instance of the given checked exception type. | 
| static ExecutorService | MoreExecutors. getExitingExecutorService(ThreadPoolExecutor executor)Converts the given ThreadPoolExecutor into an ExecutorService that exits when the application
 is complete. | 
| static ExecutorService | MoreExecutors. getExitingExecutorService(ThreadPoolExecutor executor,
                         Duration terminationTimeout)Converts the given ThreadPoolExecutor into an ExecutorService that exits when the application
 is complete. | 
| static ExecutorService | MoreExecutors. getExitingExecutorService(ThreadPoolExecutor executor,
                         long terminationTimeout,
                         TimeUnit timeUnit)Converts the given ThreadPoolExecutor into an ExecutorService that exits when the application
 is complete. | 
| static ScheduledExecutorService | MoreExecutors. getExitingScheduledExecutorService(ScheduledThreadPoolExecutor executor)Converts the given ScheduledThreadPoolExecutor into a ScheduledExecutorService that exits when
 the application is complete. | 
| static ScheduledExecutorService | MoreExecutors. getExitingScheduledExecutorService(ScheduledThreadPoolExecutor executor,
                                  Duration terminationTimeout)Converts the given ScheduledThreadPoolExecutor into a ScheduledExecutorService that exits when
 the application is complete. | 
| static ScheduledExecutorService | MoreExecutors. getExitingScheduledExecutorService(ScheduledThreadPoolExecutor executor,
                                  long terminationTimeout,
                                  TimeUnit timeUnit)Converts the given ScheduledThreadPoolExecutor into a ScheduledExecutorService that exits when
 the application is complete. | 
| static <V> V | Uninterruptibles. getUninterruptibly(Future<V> future,
                  Duration timeout)Invokes  future.get(timeout, unit)uninterruptibly. | 
| static <V> V | Uninterruptibles. getUninterruptibly(Future<V> future,
                  long timeout,
                  TimeUnit unit)Invokes  future.get(timeout, unit)uninterruptibly. | 
| static void | Uninterruptibles. joinUninterruptibly(Thread toJoin)Invokes  toJoin.join()uninterruptibly. | 
| static void | Uninterruptibles. joinUninterruptibly(Thread toJoin,
                   Duration timeout)Invokes  unit.timedJoin(toJoin, timeout)uninterruptibly. | 
| static void | Uninterruptibles. joinUninterruptibly(Thread toJoin,
                   long timeout,
                   TimeUnit unit)Invokes  unit.timedJoin(toJoin, timeout)uninterruptibly. | 
| static <I,O> Future<O> | Futures. lazyTransform(Future<I> input,
             Function<? super I,? extends O> function)Like  Futures.transform(ListenableFuture, Function, Executor)except that the transformationfunctionis invoked on each call toget()on the returned future. | 
| static ListeningExecutorService | MoreExecutors. listeningDecorator(ExecutorService delegate)Creates an  ExecutorServicewhosesubmitandinvokeAllmethods submitListenableFutureTaskinstances to the given delegate executor. | 
| static ListeningScheduledExecutorService | MoreExecutors. listeningDecorator(ScheduledExecutorService delegate)Creates a  ScheduledExecutorServicewhosesubmitandinvokeAllmethods
 submitListenableFutureTaskinstances to the given delegate executor. | 
| static ListeningExecutorService | MoreExecutors. newDirectExecutorService()Creates an executor service that runs each task in the thread that invokes  execute/submit, as inThreadPoolExecutor.CallerRunsPolicyThis applies both to individually submitted
 tasks and to collections of tasks submitted viainvokeAllorinvokeAny. | 
| static Executor | MoreExecutors. newSequentialExecutor(Executor delegate)Returns an  Executorthat runs each task executed sequentially, such that no two tasks
 are running concurrently. | 
| static ThreadFactory | MoreExecutors. platformThreadFactory()Returns a default thread factory used to create new threads. | 
| static <E> void | Uninterruptibles. putUninterruptibly(BlockingQueue<E> queue,
                  E element)Invokes  queue.put(element)uninterruptibly. | 
| static <O> ListenableFuture<O> | Futures. scheduleAsync(AsyncCallable<O> callable,
             Duration delay,
             ScheduledExecutorService executorService)Schedules  callableon the specifiedexecutor, returning aFuture. | 
| static <O> ListenableFuture<O> | Futures. scheduleAsync(AsyncCallable<O> callable,
             long delay,
             TimeUnit timeUnit,
             ScheduledExecutorService executorService)Schedules  callableon the specifiedexecutor, returning aFuture. | 
| static boolean | MoreExecutors. shutdownAndAwaitTermination(ExecutorService service,
                           Duration timeout)Shuts down the given executor service gradually, first disabling new submissions and later, if
 necessary, cancelling remaining tasks. | 
| static boolean | MoreExecutors. shutdownAndAwaitTermination(ExecutorService service,
                           long timeout,
                           TimeUnit unit)Shuts down the given executor service gradually, first disabling new submissions and later, if
 necessary, cancelling remaining tasks. | 
| static void | Uninterruptibles. sleepUninterruptibly(Duration sleepFor)Invokes  unit.sleep(sleepFor)uninterruptibly. | 
| static void | Uninterruptibles. sleepUninterruptibly(long sleepFor,
                    TimeUnit unit)Invokes  unit.sleep(sleepFor)uninterruptibly. | 
| static <E> E | Uninterruptibles. takeUninterruptibly(BlockingQueue<E> queue)Invokes  queue.take()uninterruptibly. | 
| static boolean | Uninterruptibles. tryAcquireUninterruptibly(Semaphore semaphore,
                         Duration timeout)Invokes  semaphore.tryAcquire(1,
 timeout, unit)uninterruptibly. | 
| static boolean | Uninterruptibles. tryAcquireUninterruptibly(Semaphore semaphore,
                         int permits,
                         Duration timeout)Invokes  semaphore.tryAcquire(permits,
 timeout, unit)uninterruptibly. | 
| static boolean | Uninterruptibles. tryAcquireUninterruptibly(Semaphore semaphore,
                         int permits,
                         long timeout,
                         TimeUnit unit)Invokes  semaphore.tryAcquire(permits,
 timeout, unit)uninterruptibly. | 
| static boolean | Uninterruptibles. tryAcquireUninterruptibly(Semaphore semaphore,
                         long timeout,
                         TimeUnit unit)Invokes  semaphore.tryAcquire(1,
 timeout, unit)uninterruptibly. | 
| FluentFuture<V> | FluentFuture. withTimeout(Duration timeout,
           ScheduledExecutorService scheduledExecutor)Returns a future that delegates to this future but will finish early (via a  TimeoutExceptionwrapped in anExecutionException) if the specified timeout expires. | 
| static <V> ListenableFuture<V> | Futures. withTimeout(ListenableFuture<V> delegate,
           Duration time,
           ScheduledExecutorService scheduledExecutor)Returns a future that delegates to another but will finish early (via a  TimeoutExceptionwrapped in anExecutionException) if the specified duration expires. | 
| static <V> ListenableFuture<V> | Futures. withTimeout(ListenableFuture<V> delegate,
           long time,
           TimeUnit unit,
           ScheduledExecutorService scheduledExecutor)Returns a future that delegates to another but will finish early (via a  TimeoutExceptionwrapped in anExecutionException) if the specified duration expires. | 
| FluentFuture<V> | FluentFuture. withTimeout(long timeout,
           TimeUnit unit,
           ScheduledExecutorService scheduledExecutor)Returns a future that delegates to this future but will finish early (via a  TimeoutExceptionwrapped in anExecutionException) if the specified timeout expires. | 
Copyright © 2010–2019. All rights reserved.