Uses of Annotation Type
com.google.common.annotations.Beta
Packages that use Beta
Package
Description
Basic utility libraries and interfaces.
This package contains generic collection interfaces and implementations, and other utilities for
working with collections.
An API for representing graph (node and edge) data.
Hash functions and related structures.
This package contains utility methods and classes for working with Java I/O; for example input
streams, output streams, readers, writers, and files.
Arithmetic functions operating on primitive values and
BigInteger
instances.Static utilities for working with the eight primitive types and
void
, and value types for
treating them as unsigned.This package contains utilities to work with Java reflection.
Concurrency utilities.
-
Uses of Beta in com.google.common.base
Classes in com.google.common.base with annotations of type BetaModifier and TypeClassDescriptionstatic final class
An object that splits strings into maps asSplitter
splits iterables and lists.final class
Low-level, high-performance utility methods related to the UTF-8 character encoding.Methods in com.google.common.base with annotations of type BetaModifier and TypeMethodDescription<A extends Appendable>
AAppends the string representation of each entry inentries
, using the previously configured separator and key-value separator, toappendable
.<A extends Appendable>
AAppends the string representation of each entry inentries
, using the previously configured separator and key-value separator, toappendable
.Joiner.MapJoiner.appendTo
(StringBuilder builder, Iterable<? extends Map.Entry<?, ?>> entries) Appends the string representation of each entry inentries
, using the previously configured separator and key-value separator, tobuilder
.Joiner.MapJoiner.appendTo
(StringBuilder builder, Iterator<? extends Map.Entry<?, ?>> entries) Appends the string representation of each entry inentries
, using the previously configured separator and key-value separator, tobuilder
.Returns a string containing the string representation of each entry inentries
, using the previously configured separator and key-value separator.Returns a string containing the string representation of each entry inentries
, using the previously configured separator and key-value separator.abstract T
Returns the contained instance if it is present;supplier.get()
otherwise.static <T> Iterable<T>
Optional.presentInstances
(Iterable<? extends Optional<? extends T>> optionals) Returns the value of each present instance from the suppliedoptionals
, in order, skipping over occurrences ofOptional.absent()
.Splitter.splitToStream
(CharSequence sequence) Splitssequence
into string components and makes them available through anStream
, which may be lazily evaluated.Returns a predicate that evaluates totrue
if the class being tested is assignable to (is a subtype of)clazz
.Splitter.withKeyValueSeparator
(char separator) Returns aMapSplitter
which splits entries based on this splitter, and splits entries into keys and values using the specified separator.Splitter.withKeyValueSeparator
(Splitter keyValueSplitter) Returns aMapSplitter
which splits entries based on this splitter, and splits entries into keys and values using the specified key-value splitter.Splitter.withKeyValueSeparator
(String separator) Returns aMapSplitter
which splits entries based on this splitter, and splits entries into keys and values using the specified separator. -
Uses of Beta in com.google.common.collect
Classes in com.google.common.collect with annotations of type BetaModifier and TypeClassDescriptionfinal class
ArrayTable<R,
C, V> Fixed-sizeTable
implementation backed by a two-dimensional array.final class
A non-blocking queue which automatically evicts elements from the head of the queue when attempting to add new elements onto the queue and it is full.protected class
A sensible implementation ofMap.entrySet()
in terms of the following methods:ForwardingMap.clear()
,ForwardingMap.containsKey(java.lang.Object)
,ForwardingMap.get(java.lang.Object)
,ForwardingMap.isEmpty()
,ForwardingMap.remove(java.lang.Object)
, andForwardingMap.size()
.protected class
A sensible implementation ofMap.keySet()
in terms of the following methods:ForwardingMap.clear()
,ForwardingMap.containsKey(java.lang.Object)
,ForwardingMap.isEmpty()
,ForwardingMap.remove(java.lang.Object)
,ForwardingMap.size()
, and theSet.iterator()
method ofForwardingMap.entrySet()
.protected class
A sensible implementation ofMap.values()
in terms of the following methods:ForwardingMap.clear()
,ForwardingMap.containsValue(java.lang.Object)
,ForwardingMap.isEmpty()
,ForwardingMap.size()
, and theSet.iterator()
method ofForwardingMap.entrySet()
.protected class
A sensible implementation ofMultiset.elementSet()
in terms of the following methods:ForwardingCollection.clear()
,ForwardingCollection.contains(java.lang.Object)
,ForwardingCollection.containsAll(java.util.Collection<?>)
,ForwardingMultiset.count(java.lang.Object)
,ForwardingCollection.isEmpty()
, theSet.size()
andSet.iterator()
methods ofForwardingMultiset.entrySet()
, andForwardingMultiset.remove(Object, int)
.protected class
A sensible implementation ofNavigableMap.descendingMap()
in terms of the methods of thisNavigableMap
.protected class
A sensible implementation ofNavigableMap.navigableKeySet()
in terms of the methods of thisNavigableMap
.protected class
A sensible implementation ofNavigableSet.descendingSet()
in terms of the other methods ofNavigableSet
, notably includingNavigableSet.descendingIterator()
.protected class
A sensible implementation ofSortedMap.keySet()
in terms of the methods ofForwardingSortedMap
.class
ForwardingSortedMultiset<E extends @Nullable Object>
A sorted multiset which forwards all its method calls to another sorted multiset.class
ImmutableRangeMap<K extends Comparable<?>,
V> ARangeMap
whose contents will never change, with many other important properties detailed atImmutableCollection
.final class
ImmutableRangeSet<C extends Comparable>
ARangeSet
whose contents will never change, with many other important properties detailed atImmutableCollection
.final class
A double-ended priority queue, which provides constant-time access to both its least element and its greatest element, as determined by the queue's specified comparator.static final class
The builder class used in creation of min-max priority queues.interface
RangeMap<K extends Comparable,
V> A mapping from disjoint nonempty ranges to non-null values.interface
RangeSet<C extends Comparable>
final class
TreeRangeMap<K extends Comparable,
V> An implementation ofRangeMap
based on aTreeMap
, supporting all optional operations.class
TreeRangeSet<C extends Comparable<?>>
class
Deprecated.Methods in com.google.common.collect with annotations of type BetaModifier and TypeMethodDescriptionfinal FluentIterable<E>
Returns a fluent iterable whose iterators traverse first the elements of this fluent iterable, followed byelements
.final FluentIterable<E>
Returns a fluent iterable whose iterators traverse first the elements of this fluent iterable, followed by those ofother
.Multimaps.asMap
(ListMultimap<K, V> multimap) static <K extends @Nullable Object,
V extends @Nullable Object>
Map<K,Collection<V>> Returnsmultimap.asMap()
.Multimaps.asMap
(SetMultimap<K, V> multimap) Multimaps.asMap
(SortedSetMultimap<K, V> multimap) Returnsmultimap.asMap()
, with its type corrected fromMap<K, Collection<V>>
toMap<K, SortedSet<V>>
.static <K,
V> ImmutableBiMap.Builder<K, V> ImmutableBiMap.builderWithExpectedSize
(int expectedSize) Returns a new builder, expecting the specified number of entries to be added.static <E> ImmutableList.Builder<E>
ImmutableList.builderWithExpectedSize
(int expectedSize) Returns a new builder, expecting the specified number of elements to be added.static <K,
V> ImmutableMap.Builder<K, V> ImmutableMap.builderWithExpectedSize
(int expectedSize) Returns a new builder, expecting the specified number of entries to be added.static <E> ImmutableSet.Builder<E>
ImmutableSet.builderWithExpectedSize
(int expectedSize) Returns a new builder, expecting the specified number of distinct elements to be added.Lists.charactersOf
(CharSequence sequence) Returns a view of the specifiedCharSequence
as aList<Character>
, viewingsequence
as a sequence of Unicode code units.static ContiguousSet<Integer>
ContiguousSet.closed
(int lower, int upper) Returns a nonempty contiguous set containing allint
values fromlower
(inclusive) toupper
(inclusive).static ContiguousSet<Long>
ContiguousSet.closed
(long lower, long upper) Returns a nonempty contiguous set containing alllong
values fromlower
(inclusive) toupper
(inclusive).static ContiguousSet<Integer>
ContiguousSet.closedOpen
(int lower, int upper) Returns a contiguous set containing allint
values fromlower
(inclusive) toupper
(exclusive).static ContiguousSet<Long>
ContiguousSet.closedOpen
(long lower, long upper) Returns a contiguous set containing alllong
values fromlower
(inclusive) toupper
(exclusive).Sets.combinations
(Set<E> set, int size) Returns the set of all subsets ofset
of sizesize
.static <T extends @Nullable Object>
FluentIterable<T>Returns a fluent iterable that combines several iterables.static <T extends @Nullable Object>
FluentIterable<T>Returns a fluent iterable that combines several iterables.static <T extends @Nullable Object>
FluentIterable<T>Returns a fluent iterable that combines two iterables.static <T extends @Nullable Object>
FluentIterable<T>Returns a fluent iterable that combines three iterables.static <T extends @Nullable Object>
FluentIterable<T>FluentIterable.concat
(Iterable<? extends T> a, Iterable<? extends T> b, Iterable<? extends T> c, Iterable<? extends T> d) Returns a fluent iterable that combines four iterables.static <E> ImmutableMultiset<E>
Multisets.copyHighestCountFirst
(Multiset<E> multiset) Returns a copy ofmultiset
as anImmutableMultiset
whose iteration order is highest count first, with ties broken by the iteration order of the original multiset.static <K,
V> ImmutableBiMap<K, V> Returns an immutable bimap containing the given entries.static <K,
V> ImmutableListMultimap<K, V> Returns an immutable multimap containing the specified entries.static <K,
V> ImmutableMap<K, V> Returns an immutable map containing the specified entries.static <K,
V> ImmutableMultimap<K, V> Returns an immutable multimap containing the specified entries.static <K,
V> ImmutableSetMultimap<K, V> Returns an immutable multimap containing the specified entries.static <K,
V> ImmutableSortedMap<K, V> Returns an immutable map containing the given entries, with keys sorted by their natural ordering.static <K,
V> ImmutableSortedMap<K, V> ImmutableSortedMap.copyOf
(Iterable<? extends Map.Entry<? extends K, ? extends V>> entries, Comparator<? super K> comparator) Returns an immutable map containing the given entries, with keys sorted by the provided comparator.static <E> ConcurrentHashMultiset<E>
ConcurrentHashMultiset.create
(ConcurrentMap<E, AtomicInteger> countMap) Creates a new, emptyConcurrentHashMultiset
usingcountMap
as the internal backing map.Multisets.difference
(Multiset<E> multiset1, Multiset<?> multiset2) Returns an unmodifiable view of the difference of two multisets.static <E> int
Queues.drain
(BlockingQueue<E> q, Collection<? super E> buffer, int numElements, long timeout, TimeUnit unit) Drains the queue asBlockingQueue.drainTo(Collection, int)
, but if the requestednumElements
elements 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, Duration timeout) Drains the queue asBlockingQueue.drainTo(Collection, int)
, but if the requestednumElements
elements 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, 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.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.Returns a view of the elements ofunfiltered
that satisfy a predicate.static <T extends @Nullable Object,
K extends @Nullable Object, V extends @Nullable Object, M extends Multimap<K, V>>
Collector<T,?, M> Multimaps.flatteningToMultimap
(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends Stream<? extends V>> valueFunction, Supplier<M> multimapSupplier) Returns aCollector
accumulating entries into aMultimap
generated from the specified supplier.default void
Multiset.forEachEntry
(ObjIntConsumer<? super E> action) Runs the specified action for each distinct element in this multiset, and the number of occurrences of that element.Streams.forEachPair
(Stream<A> streamA, Stream<B> streamB, BiConsumer<? super A, ? super B> consumer) Invokesconsumer
once for each pair of corresponding elements instreamA
andstreamB
.static <E extends @Nullable Object>
FluentIterable<E>FluentIterable.from
(E[] elements) Returns a fluent iterable containingelements
in the specified order.final String
Returns aString
containing all of the elements of this fluent iterable joined withjoiner
.Iterables.mergeSorted
(Iterable<? extends Iterable<? extends T>> iterables, Comparator<? super T> comparator) Returns an iterable over the merged contents of all giveniterables
.static <T extends @Nullable Object>
UnmodifiableIterator<T>Iterators.mergeSorted
(Iterable<? extends Iterator<? extends T>> iterators, Comparator<? super T> comparator) Returns an iterator over the merged contents of all giveniterators
, traversing every element of the input iterators.static <R,
C, V> Table<R, C, V> Tables.newCustomTable
(Map<R, Map<C, V>> backingMap, Supplier<? extends Map<C, V>> factory) Creates a table that uses the specified backing map and factory.static <E extends @Nullable Object>
FluentIterable<E>FluentIterable.of()
Returns a fluent iterable containing no elements.static <E extends @Nullable Object>
FluentIterable<E>FluentIterable.of
(E element, E... elements) Returns a fluent iterable containing the specified elements in order.static <E extends Comparable<? super E>>
Collection<List<E>>Collections2.orderedPermutations
(Iterable<E> elements) Returns aCollection
of all the permutations of the specifiedIterable
.static <E> Collection<List<E>>
Collections2.orderedPermutations
(Iterable<E> elements, Comparator<? super E> comparator) Returns aCollection
of all the permutations of the specifiedIterable
using the specifiedComparator
for establishing the lexicographical ordering.ImmutableBiMap.Builder.orderEntriesByValue
(Comparator<? super V> valueComparator) Configures thisBuilder
to order entries by value according to the specified comparator.ImmutableMap.Builder.orderEntriesByValue
(Comparator<? super V> valueComparator) Configures thisBuilder
to order entries by value according to the specified comparator.final ImmutableSortedMap.Builder<K,
V> ImmutableSortedMap.Builder.orderEntriesByValue
(Comparator<? super V> valueComparator) Deprecated.Unsupported by ImmutableSortedMap.Builder.static <E> Collection<List<E>>
Collections2.permutations
(Collection<E> elements) Returns aCollection
of all the permutations of the specifiedCollection
.Adds all of the given entries to the built bimap.ImmutableListMultimap.Builder.putAll
(Iterable<? extends Map.Entry<? extends K, ? extends V>> entries) Adds entries to the built multimap.Adds all of the given entries to the built map.Adds entries to the built multimap.Adds entries to the built multimap.Adds all the given entries to the built map.protected boolean
ForwardingMultiset.standardAddAll
(Collection<? extends E> elementsToAdd) A sensible definition ofForwardingCollection.addAll(Collection)
in terms ofForwardingCollection.add(Object)
andForwardingMultiset.add(Object, int)
.protected boolean
ForwardingSortedSet.standardContains
(Object object) A sensible definition ofForwardingCollection.contains(java.lang.Object)
in terms of thefirst()
method ofForwardingSortedSet.tailSet(E)
.protected boolean
ForwardingMap.standardContainsKey
(Object key) A sensible, albeit inefficient, definition ofForwardingMap.containsKey(java.lang.Object)
in terms of theiterator
method ofForwardingMap.entrySet()
.protected boolean
ForwardingSortedMap.standardContainsKey
(Object key) A sensible definition ofForwardingMap.containsKey(java.lang.Object)
in terms of thefirstKey()
method ofForwardingSortedMap.tailMap(K)
.protected int
ForwardingMultiset.standardCount
(Object object) A sensible, albeit inefficient, definition ofForwardingMultiset.count(java.lang.Object)
in terms ofForwardingMultiset.entrySet()
.protected NavigableSet<K>
ForwardingNavigableMap.standardDescendingKeySet()
A sensible definition ofForwardingNavigableMap.descendingKeySet()
as thenavigableKeySet
ofForwardingNavigableMap.descendingMap()
.protected boolean
ForwardingList.standardEquals
(Object object) A sensible definition ofForwardingList.equals(Object)
in terms ofForwardingCollection.size()
andForwardingCollection.iterator()
.protected int
ForwardingList.standardHashCode()
A sensible definition ofForwardingList.hashCode()
in terms ofForwardingCollection.iterator()
.protected ListIterator<E>
ForwardingList.standardListIterator
(int start) A sensible default implementation ofForwardingList.listIterator(int)
, in terms ofForwardingCollection.size()
,ForwardingList.get(int)
,ForwardingList.set(int, Object)
,ForwardingList.add(int, Object)
, andForwardingList.remove(int)
.protected V
ForwardingMap.standardRemove
(Object key) A sensible, albeit inefficient, definition ofForwardingMap.remove(java.lang.Object)
in terms of theiterator
method ofForwardingMap.entrySet()
.protected boolean
ForwardingSortedSet.standardRemove
(Object object) A sensible definition ofForwardingCollection.remove(java.lang.Object)
in terms of theiterator()
method ofForwardingSortedSet.tailSet(E)
.ForwardingList.standardSubList
(int fromIndex, int toIndex) A sensible default implementation ofForwardingList.subList(int, int)
.ForwardingSortedMap.standardSubMap
(K fromKey, K toKey) A sensible default implementation ofForwardingSortedMap.subMap(Object, Object)
in terms ofForwardingSortedMap.headMap(Object)
andForwardingSortedMap.tailMap(Object)
.protected NavigableSet<E>
ForwardingNavigableSet.standardSubSet
(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) A sensible definition ofForwardingNavigableSet.subSet(Object, boolean, Object, boolean)
in terms of theheadSet
andtailSet
methods.ForwardingSortedSet.standardSubSet
(E fromElement, E toElement) A sensible default implementation ofForwardingSortedSet.subSet(Object, Object)
in terms ofForwardingSortedSet.headSet(Object)
andForwardingSortedSet.tailSet(Object)
.protected String
ForwardingMapEntry.standardToString()
A sensible definition ofForwardingObject.toString()
in terms ofForwardingMapEntry.getKey()
andForwardingMapEntry.getValue()
.static <T> Stream<T>
If a value is present inoptional
, returns a stream containing only that element, otherwise returns an empty stream.Streams.stream
(Collection<T> collection) Deprecated.There is no reason to use this; just invokecollection.stream()
directly.Returns a sequentialStream
of the remaining contents ofiterator
.static <T> Stream<T>
If a value is present inoptional
, returns a stream containing only that element, otherwise returns an empty stream.static DoubleStream
Streams.stream
(OptionalDouble optional) If a value is present inoptional
, returns a stream containing only that element, otherwise returns an empty stream.static IntStream
Streams.stream
(OptionalInt optional) If a value is present inoptional
, returns a stream containing only that element, otherwise returns an empty stream.static LongStream
Streams.stream
(OptionalLong optional) If a value is present inoptional
, returns a stream containing only that element, otherwise returns an empty stream.static <K extends Comparable<? super K>,
V extends @Nullable Object>
NavigableMap<K,V> Maps.subMap
(NavigableMap<K, V> map, Range<K> range) Returns a view of the portion ofmap
whose keys are contained byrange
.static <K extends Comparable<? super K>>
NavigableSet<K>Sets.subSet
(NavigableSet<K> set, Range<K> range) Returns a view of the portion ofset
whose elements are contained byrange
.Returns an unmodifiable view of the sum of two multisets.static <T extends @Nullable Object,
R extends @Nullable Object, C extends @Nullable Object, V extends @Nullable Object, I extends Table<R, C, V>>
Collector<T,?, I> Tables.toTable
(Function<? super T, ? extends R> rowFunction, Function<? super T, ? extends C> columnFunction, Function<? super T, ? extends V> valueFunction, Supplier<I> tableSupplier) Returns aCollector
that accumulates elements into aTable
created using the specified supplier, whose cells are generated by applying the provided mapping functions to the input elements.static <R extends @Nullable Object,
C extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object>
Table<R,C, V2> Tables.transformValues
(Table<R, C, V1> fromTable, Function<? super V1, V2> function) Returns a view of a table where each value is transformed by a function.Returns an unmodifiable view of the union of two multisets.static <R extends @Nullable Object,
C extends @Nullable Object, V extends @Nullable Object>
RowSortedTable<R,C, V> Tables.unmodifiableRowSortedTable
(RowSortedTable<R, ? extends C, ? extends V> table) Returns an unmodifiable view of the specified row-sorted table.static <E extends @Nullable Object>
SortedMultiset<E>Multisets.unmodifiableSortedMultiset
(SortedMultiset<E> sortedMultiset) Returns an unmodifiable view of the specified sorted multiset.static <A extends @Nullable Object,
B extends @Nullable Object, R extends @Nullable Object>
Stream<R>Streams.zip
(Stream<A> streamA, Stream<B> streamB, BiFunction<? super A, ? super B, R> function) Returns a stream in which each element is the result of passing the corresponding element of each ofstreamA
andstreamB
tofunction
. -
Uses of Beta in com.google.common.graph
Classes in com.google.common.graph with annotations of type BetaModifier and TypeClassDescriptionclass
This class provides a skeletal implementation ofGraph
.class
AbstractNetwork<N,
E> This class provides a skeletal implementation ofNetwork
.class
AbstractValueGraph<N,
V> This class provides a skeletal implementation ofValueGraph
.final class
ElementOrder<T>
Used to represent the order of elements in a data structure that supports different options for iteration order guarantees.class
EndpointPair<N>
An immutable pair representing the two endpoints of an edge in a graph.interface
Graph<N>
An interface for graph-structured data, whose edges are anonymous entities with no identity or information of their own.final class
GraphBuilder<N>
A builder for constructing instances ofMutableGraph
orImmutableGraph
with user-defined properties.final class
class
AGraph
whose elements and structural relationships will never change.final class
ImmutableNetwork<N,
E> ANetwork
whose elements and structural relationships will never change.final class
ImmutableValueGraph<N,
V> AValueGraph
whose elements and structural relationships will never change.interface
MutableGraph<N>
A subinterface ofGraph
which adds mutation methods.interface
MutableNetwork<N,
E> A subinterface ofNetwork
which adds mutation methods.interface
MutableValueGraph<N,
V> A subinterface ofValueGraph
which adds mutation methods.interface
Network<N,
E> An interface for graph-structured data, whose edges are unique objects.final class
NetworkBuilder<N,
E> A builder for constructing instances ofMutableNetwork
orImmutableNetwork
with user-defined properties.interface
A functional interface for graph-structured data.interface
A functional interface for graph-structured data.class
Traverser<N>
An object that can traverse the nodes that are reachable from a specified (set of) start node(s) using a specifiedSuccessorsFunction
.interface
ValueGraph<N,
V> An interface for graph-structured data, whose edges have associated non-unique values.final class
ValueGraphBuilder<N,
V> A builder for constructing instances ofMutableValueGraph
orImmutableValueGraph
with user-defined properties. -
Uses of Beta in com.google.common.hash
Classes in com.google.common.hash with annotations of type BetaModifier and TypeClassDescriptionfinal class
BloomFilter<T extends @Nullable Object>
A Bloom filter for instances ofT
.interface
An object which can send data from an object of typeT
into aPrimitiveSink
.final class
Funnels for common types.interface
APrimitiveSink
that can compute a hash code after reading the input.final class
AnInputStream
that maintains a hash of the data read from it.final class
AnOutputStream
that maintains a hash of the data written to it.interface
An object which can receive a stream of primitive values. -
Uses of Beta in com.google.common.io
Classes in com.google.common.io with annotations of type BetaModifier and TypeInterfaceDescriptioninterface
ByteProcessor<T extends @Nullable Object>
A callback interface to process bytes from a stream.final class
Utility methods for working withCloseable
objects.final class
final class
AnInputStream
that counts the number of bytes read.final class
AnOutputStream
that starts buffering to a byte array, but switches to file buffering once the data reaches a configurable size.final class
Utility methods for working withFlushable
objects.final class
Exception 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.,SecureDirectoryStream
is not supported).interface
LineProcessor<T extends @Nullable Object>
A callback to be used with the streamingreadLines
methods.final class
A class for reading lines of text.final class
An implementation ofDataInput
that uses little-endian byte ordering for readingshort
,int
,float
,double
, andlong
values.final class
An implementation ofDataOutput
that uses little-endian byte ordering for writingchar
,short
,int
,float
,double
, andlong
values.final class
final class
File name filter that only accepts files matching a regular expression.enum
Options 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...)
).Methods in com.google.common.io with annotations of type BetaModifier and TypeMethodDescriptionCharSource.asByteSource
(Charset charset) Returns aByteSource
view of this char source that encodes chars read from this source as bytes using the givenCharset
.static Writer
CharStreams.asWriter
(Appendable target) Returns a Writer that sends all output to the givenAppendable
target.static File
Files.createTempDir()
Deprecated.For Android users, see the Data and File Storage overview to select an appropriate temporary directory (perhapscontext.getCacheDir()
).static long
ByteStreams.exhaust
(InputStream in) Reads and discards data from the givenInputStream
until the end of the stream is reached.static long
Reads and discards data from the givenReadable
until the end of the stream is reached.Files.fileTraverser()
Returns aTraverser
instance for the file and directory tree.void
CharSource.forEachLine
(Consumer<? super String> action) Reads all lines of text from this source, running the givenaction
for each line as it is read.long
CharSource.length()
Returns the length of this source in chars, even if doing so requires opening and traversing an entire stream.CharSource.lengthIfKnown()
Returns the size of this source in chars, if the size can be easily determined without actually opening the data stream.static InputStream
ByteStreams.limit
(InputStream in, long limit) Wraps aInputStream
, limiting the number of bytes which can be read.CharSource.lines()
Opens a newStream
for reading text one line at a time from this source.static ByteArrayDataInput
ByteStreams.newDataInput
(byte[] bytes) Returns a newByteArrayDataInput
instance to read from thebytes
array from the beginning.static ByteArrayDataInput
ByteStreams.newDataInput
(byte[] bytes, int start) Returns a newByteArrayDataInput
instance to read from thebytes
array, starting at the given position.static ByteArrayDataInput
ByteStreams.newDataInput
(ByteArrayInputStream byteArrayInputStream) Returns a newByteArrayDataInput
instance to read from the givenByteArrayInputStream
.static ByteArrayDataOutput
ByteStreams.newDataOutput()
Returns a newByteArrayDataOutput
instance with a default size.static ByteArrayDataOutput
ByteStreams.newDataOutput
(int size) Returns a newByteArrayDataOutput
instance sized to holdsize
bytes before resizing.static ByteArrayDataOutput
ByteStreams.newDataOutput
(ByteArrayOutputStream byteArrayOutputStream) Returns a newByteArrayDataOutput
instance which writes to the givenByteArrayOutputStream
.static OutputStream
ByteStreams.nullOutputStream()
Returns anOutputStream
that simply discards written bytes.static Writer
CharStreams.nullWriter()
Returns aWriter
that simply discards written chars.<T extends @Nullable Object>
TByteSource.read
(ByteProcessor<T> processor) Reads the contents of this byte source using the givenprocessor
to process bytes as they are read.static int
ByteStreams.read
(InputStream in, byte[] b, int off, int len) Reads some bytes from an input stream and stores them into the buffer arrayb
.static <T extends @Nullable Object>
TByteStreams.readBytes
(InputStream input, ByteProcessor<T> processor) Process the bytes of the given input stream using the given processor.static void
ByteStreams.readFully
(InputStream in, byte[] b) Attempts to read enough bytes from the stream to fill the given byte array, with the same behavior asDataInput.readFully(byte[])
.static void
ByteStreams.readFully
(InputStream in, byte[] b, int off, int len) Attempts to readlen
bytes from the stream into the given array starting atoff
, with the same behavior asDataInput.readFully(byte[], int, int)
.<T extends @Nullable Object>
TCharSource.readLines
(LineProcessor<T> processor) Reads lines of text from this source, processing each line as it is read using the givenprocessor
.Reads all of the lines from aReadable
object.static <T extends @Nullable Object>
TCharStreams.readLines
(Readable readable, LineProcessor<T> processor) Streams lines from aReadable
object, stopping when the processor returnsfalse
or all lines have been read and returning the result produced by the processor.ByteSource.sizeIfKnown()
Returns the size of this source in bytes, if the size can be easily determined without actually opening the data stream.static void
ByteStreams.skipFully
(InputStream in, long n) Discardsn
bytes of data from the input stream.static void
Discardsn
characters of data from the reader.void
CharSink.writeLines
(Stream<? extends CharSequence> lines) Writes the given lines of text to this sink with each line (including the last) terminated with the operating system's default line separator.void
CharSink.writeLines
(Stream<? extends CharSequence> lines, String lineSeparator) Writes the given lines of text to this sink with each line (including the last) terminated with the given line separator. -
Uses of Beta in com.google.common.math
Classes in com.google.common.math with annotations of type BetaModifier and TypeClassDescriptionclass
The representation of a linear transformation between real numbersx
andy
.final class
An immutable value object capturing some basic statistics about a collection of paired double values (e.g.final class
A mutable object which accumulates paired double values (e.g.final class
Provides a fluent API for calculating quantiles.final class
A 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.final class
A mutable object which accumulates double values and tracks some basic statistics over all the values added so far.Methods in com.google.common.math with annotations of type BetaModifier and TypeMethodDescriptionstatic BigInteger
BigIntegerMath.ceilingPowerOfTwo
(BigInteger x) Returns the smallest power of two greater than or equal tox
.static int
IntMath.ceilingPowerOfTwo
(int x) Returns the smallest power of two greater than or equal tox
.static long
LongMath.ceilingPowerOfTwo
(long x) Returns the smallest power of two greater than or equal tox
.static BigInteger
BigIntegerMath.floorPowerOfTwo
(BigInteger x) Returns the largest power of two less than or equal tox
.static int
IntMath.floorPowerOfTwo
(int x) Returns the largest power of two less than or equal tox
.static long
LongMath.floorPowerOfTwo
(long x) Returns the largest power of two less than or equal tox
.static boolean
IntMath.isPrime
(int n) Returnstrue
ifn
is 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) Returnstrue
ifn
is a prime number: an integer greater than one that cannot be factored into a product of smaller positive integers.static int
IntMath.saturatedAdd
(int a, int b) Returns the sum ofa
andb
unless it would overflow or underflow in which caseInteger.MAX_VALUE
orInteger.MIN_VALUE
is returned, respectively.static long
LongMath.saturatedAdd
(long a, long b) Returns the sum ofa
andb
unless it would overflow or underflow in which caseLong.MAX_VALUE
orLong.MIN_VALUE
is returned, respectively.static int
IntMath.saturatedMultiply
(int a, int b) Returns the product ofa
andb
unless it would overflow or underflow in which caseInteger.MAX_VALUE
orInteger.MIN_VALUE
is returned, respectively.static long
LongMath.saturatedMultiply
(long a, long b) Returns the product ofa
andb
unless it would overflow or underflow in which caseLong.MAX_VALUE
orLong.MIN_VALUE
is returned, respectively.static int
IntMath.saturatedPow
(int b, int k) Returns theb
to thek
th power, unless it would overflow or underflow in which caseInteger.MAX_VALUE
orInteger.MIN_VALUE
is returned, respectively.static long
LongMath.saturatedPow
(long b, int k) Returns theb
to thek
th power, unless it would overflow or underflow in which caseLong.MAX_VALUE
orLong.MIN_VALUE
is returned, respectively.static int
IntMath.saturatedSubtract
(int a, int b) Returns the difference ofa
andb
unless it would overflow or underflow in which caseInteger.MAX_VALUE
orInteger.MIN_VALUE
is returned, respectively.static long
LongMath.saturatedSubtract
(long a, long b) Returns the difference ofa
andb
unless it would overflow or underflow in which caseLong.MAX_VALUE
orLong.MIN_VALUE
is returned, respectively. -
Uses of Beta in com.google.common.primitives
Classes in com.google.common.primitives with annotations of type BetaModifier and TypeClassDescriptionfinal class
An immutable array ofdouble
values, with an API resemblingList
.final class
An immutable array ofint
values, with an API resemblingList
.final class
An immutable array oflong
values, with an API resemblingList
.final class
Static utility methods pertaining toint
primitives that interpret values as unsigned (that is, any negative valuex
is treated as the positive value2^32 + x
).final class
Static utility methods pertaining tolong
primitives that interpret values as unsigned (that is, any negative valuex
is treated as the positive value2^64 + x
).Methods in com.google.common.primitives with annotations of type BetaModifier and TypeMethodDescriptionstatic char
Chars.constrainToRange
(char value, char min, char max) Returns the value nearest tovalue
which is within the closed range[min..max]
.static double
Doubles.constrainToRange
(double value, double min, double max) Returns the value nearest tovalue
which is within the closed range[min..max]
.static float
Floats.constrainToRange
(float value, float min, float max) Returns the value nearest tovalue
which is within the closed range[min..max]
.static int
Ints.constrainToRange
(int value, int min, int max) Returns the value nearest tovalue
which is within the closed range[min..max]
.static long
Longs.constrainToRange
(long value, long min, long max) Returns the value nearest tovalue
which is within the closed range[min..max]
.static short
Shorts.constrainToRange
(short value, short min, short max) Returns the value nearest tovalue
which is within the closed range[min..max]
.static int
Booleans.countTrue
(boolean... values) Returns the number ofvalues
that aretrue
.static Comparator<Boolean>
Booleans.falseFirst()
Returns aComparator<Boolean>
that sortsfalse
beforetrue
.static byte
UnsignedBytes.parseUnsignedByte
(String string) Returns the unsignedbyte
value represented by the given decimal string.static byte
UnsignedBytes.parseUnsignedByte
(String string, int radix) Returns the unsignedbyte
value represented by a string with the given radix.Doubles.stringConverter()
Returns a serializable converter object that converts between strings and doubles usingDouble.valueOf(java.lang.String)
andDouble.toString()
.Floats.stringConverter()
Returns a serializable converter object that converts between strings and floats usingFloat.valueOf(java.lang.String)
andFloat.toString()
.Ints.stringConverter()
Returns a serializable converter object that converts between strings and integers usingInteger.decode(java.lang.String)
andInteger.toString()
.Longs.stringConverter()
Returns a serializable converter object that converts between strings and longs usingLong.decode(java.lang.String)
andLong.toString()
.Shorts.stringConverter()
Returns a serializable converter object that converts between strings and shorts usingShort.decode(java.lang.String)
andShort.toString()
.static String
UnsignedBytes.toString
(byte x) Returns a string representation of x, where x is treated as unsigned.static String
UnsignedBytes.toString
(byte x, int radix) Returns a string representation ofx
for the given radix, wherex
is treated as unsigned.static Comparator<Boolean>
Booleans.trueFirst()
Returns aComparator<Boolean>
that sortstrue
beforefalse
.static Double
Parses the specified string as a double-precision floating point value.static Float
Parses the specified string as a single-precision floating point value.static Integer
Parses the specified string as a signed decimal integer value.static Integer
Parses the specified string as a signed integer value using the specified radix.static Long
Parses the specified string as a signed decimal long value.static Long
Parses the specified string as a signed long value using the specified radix. -
Uses of Beta in com.google.common.reflect
Classes in com.google.common.reflect with annotations of type BetaModifier and TypeClassDescriptionclass
Invokable<T,
R> Wrapper around either aMethod
or aConstructor
.final class
Represents a method or constructor parameter.Methods in com.google.common.reflect with annotations of type Beta -
Uses of Beta in com.google.common.util.concurrent
Classes in com.google.common.util.concurrent with annotations of type BetaModifier and TypeClassDescriptionclass
AbstractListeningExecutorService
implementation that createsListenableFuture
instances for eachRunnable
andCallable
submitted to it.class
TheCycleDetectingLockFactory
createsReentrantLock
instances andReentrantReadWriteLock
instances that detect potential deadlock by checking for cycles in lock acquisition order.static enum
Pre-definedCycleDetectingLockFactory.Policy
implementations.static interface
Encapsulates the action to be taken when a potential deadlock is encountered.static final class
Represents a detected cycle in lock acquisition ordering.static final class
CycleDetectingLockFactory.WithExplicitOrdering<E extends Enum<E>>
ACycleDetectingLockFactory.WithExplicitOrdering
provides the additional enforcement of an application-specified ordering of lock acquisitions.final class
A TimeLimiter implementation which actually does not attempt to limit time at all.static final class
Futures.FutureCombiner<V extends @Nullable Object>
A helper to create a newListenableFuture
whose result is generated from a combination of input futures.final class
Utilities necessary for working with libraries that supply plainFuture
instances.class
A rate limiter.final class
Static utility methods pertaining to theRunnable
interface.final class
A TimeLimiter that runs method calls in the background using anExecutorService
.class
Striped<L>
A stripedLock/Semaphore/ReadWriteLock
.interface
Imposes a time limit on method calls.Methods in com.google.common.util.concurrent with annotations of type BetaModifier and TypeMethodDescriptionstatic void
MoreExecutors.addDelayedShutdownHook
(ExecutorService service, long terminationTimeout, TimeUnit timeUnit) Add a shutdown hook to wait for thread completion in the givenservice
.static void
MoreExecutors.addDelayedShutdownHook
(ExecutorService service, Duration terminationTimeout) Add a shutdown hook to wait for thread completion in the givenservice
.protected void
AbstractFuture.afterDone()
Callback method that is called exactly once after the future is completed.static <V extends @Nullable Object>
ListenableFuture<List<V>>Futures.allAsList
(ListenableFuture<? extends V>... futures) Creates a newListenableFuture
whose value is a list containing the values of all its input futures, if all succeed.static <V extends @Nullable Object>
ListenableFuture<List<V>>Futures.allAsList
(Iterable<? extends ListenableFuture<? extends V>> futures) Creates a newListenableFuture
whose value is a list containing the values of all its input futures, if all succeed.static <T extends @Nullable Object>
AsyncCallable<T>Callables.asAsyncCallable
(Callable<T> callable, ListeningExecutorService listeningExecutorService) Creates anAsyncCallable
from aCallable
.final <X extends Throwable>
FluentFuture<V>FluentFuture.catching
(Class<X> exceptionType, Function<? super X, ? extends V> fallback, Executor executor) Returns aFuture
whose result is taken from thisFuture
or, if thisFuture
fails with the givenexceptionType
, from the result provided by thefallback
.static <V extends @Nullable Object,
X extends Throwable>
ListenableFuture<V>Futures.catching
(ListenableFuture<? extends V> input, Class<X> exceptionType, Function<? super X, ? extends V> fallback, Executor executor) Returns aFuture
whose result is taken from the given primaryinput
or, if the primary input fails with the givenexceptionType
, from the result provided by thefallback
.final <X extends Throwable>
FluentFuture<V>FluentFuture.catchingAsync
(Class<X> exceptionType, AsyncFunction<? super X, ? extends V> fallback, Executor executor) Returns aFuture
whose result is taken from thisFuture
or, if thisFuture
fails with the givenexceptionType
, from the result provided by thefallback
.static <V extends @Nullable Object,
X extends Throwable>
ListenableFuture<V>Futures.catchingAsync
(ListenableFuture<? extends V> input, Class<X> exceptionType, AsyncFunction<? super X, ? extends V> fallback, Executor executor) Returns aFuture
whose result is taken from the given primaryinput
or, if the primary input fails with the givenexceptionType
, from the result provided by thefallback
.protected void
AbstractService.doCancelStart()
This method is called byAbstractService.stopAsync()
when the service is still starting (i.e.Futures.getChecked
(Future<V> future, Class<X> exceptionClass) Returns the result ofFuture.get()
, converting most exceptions to a new instance of the given checked exception type.Futures.getChecked
(Future<V> future, Class<X> exceptionClass, long timeout, TimeUnit unit) Returns the result ofFuture.get(long, TimeUnit)
, converting most exceptions to a new instance of the given checked exception type.Futures.getChecked
(Future<V> future, Class<X> exceptionClass, Duration timeout) Returns the result ofFuture.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, long terminationTimeout, TimeUnit timeUnit) 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 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, long terminationTimeout, TimeUnit timeUnit) 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.Futures.lazyTransform
(Future<I> input, Function<? super I, ? extends O> function) LikeFutures.transform(ListenableFuture, Function, Executor)
except that the transformationfunction
is invoked on each call toget()
on the returned future.static ThreadFactory
MoreExecutors.platformThreadFactory()
Returns a default thread factory used to create new threads.boolean
AtomicLongMap.removeIfZero
(K key) Atomically removekey
from the map iff its associated value is 0.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 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 <V extends @Nullable Object>
ListenableFuture<List<@Nullable V>>Futures.successfulAsList
(ListenableFuture<? extends V>... futures) Creates a newListenableFuture
whose value is a list containing the values of all its successful input futures.static <V extends @Nullable Object>
ListenableFuture<List<@Nullable V>>Futures.successfulAsList
(Iterable<? extends ListenableFuture<? extends V>> futures) Creates a newListenableFuture
whose value is a list containing the values of all its successful input futures.final <T extends @Nullable Object>
FluentFuture<T>Returns a newFuture
whose result is derived from the result of thisFuture
.static <I extends @Nullable Object,
O extends @Nullable Object>
ListenableFuture<O>Futures.transform
(ListenableFuture<I> input, Function<? super I, ? extends O> function, Executor executor) Returns a newFuture
whose result is derived from the result of the givenFuture
.final <T extends @Nullable Object>
FluentFuture<T>FluentFuture.transformAsync
(AsyncFunction<? super V, T> function, Executor executor) Returns a newFuture
whose result is asynchronously derived from the result of thisFuture
.static <I extends @Nullable Object,
O extends @Nullable Object>
ListenableFuture<O>Futures.transformAsync
(ListenableFuture<I> input, AsyncFunction<? super I, ? extends O> function, Executor executor) Returns a newFuture
whose result is asynchronously derived from the result of the givenFuture
.protected void
AbstractExecutionThreadService.triggerShutdown()
Invoked to request the service to stop.static <V extends @Nullable Object>
Futures.FutureCombiner<V>Futures.whenAllComplete
(ListenableFuture<? extends V>... futures) Creates aFutures.FutureCombiner
that processes the completed futures whether or not they're successful.static <V extends @Nullable Object>
Futures.FutureCombiner<V>Futures.whenAllComplete
(Iterable<? extends ListenableFuture<? extends V>> futures) Creates aFutures.FutureCombiner
that processes the completed futures whether or not they're successful.static <V extends @Nullable Object>
Futures.FutureCombiner<V>Futures.whenAllSucceed
(ListenableFuture<? extends V>... futures) Creates aFutures.FutureCombiner
requiring that all passed in futures are successful.static <V extends @Nullable Object>
Futures.FutureCombiner<V>Futures.whenAllSucceed
(Iterable<? extends ListenableFuture<? extends V>> futures) Creates aFutures.FutureCombiner
requiring that all passed in futures are successful.final FluentFuture<V>
FluentFuture.withTimeout
(long timeout, TimeUnit unit, ScheduledExecutorService scheduledExecutor) Returns a future that delegates to this future but will finish early (via aTimeoutException
wrapped in anExecutionException
) if the specified timeout expires.final FluentFuture<V>
FluentFuture.withTimeout
(Duration timeout, ScheduledExecutorService scheduledExecutor) Returns a future that delegates to this future but will finish early (via aTimeoutException
wrapped in anExecutionException
) if the specified timeout expires.static <V extends @Nullable Object>
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 aTimeoutException
wrapped in anExecutionException
) if the specified duration expires.static <V extends @Nullable Object>
ListenableFuture<V>Futures.withTimeout
(ListenableFuture<V> delegate, Duration time, ScheduledExecutorService scheduledExecutor) Returns a future that delegates to another but will finish early (via aTimeoutException
wrapped in anExecutionException
) if the specified duration expires. -
Uses of Beta in com.google.thirdparty.publicsuffix
Classes in com.google.thirdparty.publicsuffix with annotations of type BetaModifier and TypeClassDescriptionfinal class
Do not use this class directly.enum
Do not use this class directly.
Traverser
instead.