-
Deprecated ClassesClassDescriptionUse
Traverserinstead. All instance methods have their equivalent on the result ofTraverser.forTree(tree)wheretreeimplementsSuccessorsFunction, which has a similar API asTreeTraverser.children(T)or can be the same lambda function as passed intoTreeTraverser.using(Function).This class is scheduled to be removed in October 2019.
-
Deprecated ExceptionsExceptionsDescriptionThis exception is no longer thrown by
com.google.common. Previously, it was thrown byMapMakercomputing maps. When support for computing maps was removed fromMapMaker, it was added toCacheBuilder, which throwsExecutionException,UncheckedExecutionException, andExecutionError. Any code that is still catchingComputationExceptionmay need to be updated to catch some of those types instead. (Note that this type, though deprecated, is not planned to be removed from Guava.)
-
Deprecated MethodsMethodDescriptionProvided only to satisfy the
Predicateinterface; useCharMatcher.matches(char)instead.Many digits are supplementary characters; see the class documentation.Most invisible characters are supplementary characters; see the class documentation.Many digits are supplementary characters; see the class documentation.Most letters are supplementary characters; see the class documentation.Most letters and digits are supplementary characters; see the class documentation.Some lowercase characters are supplementary characters; see the class documentation.Some uppercase characters are supplementary characters; see the class documentation.Many such characters are supplementary characters; see the class documentation.Provided to satisfy theFunctioninterface; useConverter.convert(A)instead.Provided only to satisfy theBiPredicateinterface; useEquivalence.equivalent(T, T)instead.Usethrow 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.UseThrowables.throwIfInstanceOf(java.lang.Throwable, java.lang.Class<X>), which has the same behavior but rejectsnull.UseThrowables.throwIfUnchecked(java.lang.Throwable), which has the same behavior but rejectsnull.Provided to satisfy theFunctioninterface; useLoadingCache.get(K)orLoadingCache.getUnchecked(K)instead.For aListMultimapthat automatically trims to size, useImmutableListMultimap. If you need a mutable collection, remove thetrimToSizecall, or switch to aHashMap<K, ArrayList<V>>.UseComparisonChain.compareFalseFirst(boolean, boolean); or, if the parameters passed are being either negated or reversed, undo the negation or reversal and useComparisonChain.compareTrueFirst(boolean, boolean).Internal method, useAbstractMultiset.entrySet().instances ofFluentIterabledon't need to be converted toFluentIterableUnsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.There is no reason to use this; it always returnsthis.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported by ImmutableSortedMap.Builder.Unsupported operation.Unsupported operation.UseImmutableSortedMap.naturalOrder(), which offers better type-safety.Not supported for ImmutableSortedMap.Pass a key of typeComparableto useImmutableSortedMap.of(Comparable, Object).Pass keys of typeComparableto useImmutableSortedMap.of(Comparable, Object, Comparable, Object).Pass keys of typeComparableto useImmutableSortedMap.of(Comparable, Object, Comparable, Object, Comparable, Object).Pass keys of typeComparableto useImmutableSortedMap.of(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Pass keys of typeComparableto useImmutableSortedMap.of(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Pass keys of typeComparableto useImmutableSortedMap.of(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Pass keys of typeComparableto useImmutableSortedMap.of(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Pass keys of typeComparableto useImmutableSortedMap.of(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Pass keys of typeComparableto useImmutableSortedMap.of(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Pass keys of typeComparableto useImmutableSortedMap.of(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).UseImmutableSortedMap.copyOf(ImmutableMap.ofEntries(...)).Unsupported operation.Unsupported operation.UseImmutableSortedMultiset.naturalOrder(), which offers better type-safety.Pass parameters of typeComparableto useImmutableSortedMultiset.copyOf(Comparable[]).Pass a parameter of typeComparableto useImmutableSortedMultiset.of(Comparable).Pass the parameters of typeComparableto useImmutableSortedMultiset.of(Comparable, Comparable).Pass the parameters of typeComparableto useImmutableSortedMultiset.of(Comparable, Comparable, Comparable).Pass the parameters of typeComparableto useImmutableSortedMultiset.of(Comparable, Comparable, Comparable, Comparable).Pass the parameters of typeComparableto useImmutableSortedMultiset.of(Comparable, Comparable, Comparable, Comparable, Comparable).Pass the parameters of typeComparableto useImmutableSortedMultiset.of(Comparable, Comparable, Comparable, Comparable, Comparable, Comparable, Comparable...).Unsupported operation.Unsupported operation.UseImmutableSortedSet.naturalOrder(), which offers better type-safety.Not supported by ImmutableSortedSet.Pass parameters of typeComparableto useImmutableSortedSet.copyOf(Comparable[]).Pass a parameter of typeComparableto useImmutableSortedSet.of(Comparable).Pass the parameters of typeComparableto useImmutableSortedSet.of(Comparable, Comparable).Pass the parameters of typeComparableto useImmutableSortedSet.of(Comparable, Comparable, Comparable).Pass the parameters of typeComparableto useImmutableSortedSet.of(Comparable, Comparable, Comparable, Comparable).Pass the parameters of typeComparableto useImmutableSortedSet.of(Comparable, Comparable, Comparable, Comparable, Comparable).Pass the parameters of typeComparableto useImmutableSortedSet.of(Comparable, Comparable, Comparable, Comparable, Comparable, Comparable, Comparable...).Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.no need to use thisno need to use thisno need to use thisno need to use thisno need to use thisno need to use thisno need to use thisUseCollections.binarySearch(List, Object, Comparator)directly.no need to use thisProvided only to satisfy thePredicateinterface; useRange.contains(C)instead.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.Unsupported operation.There is no reason to use this; just invokecollection.stream()directly.Store theComparatoralongside theTable. Or, if you know that theTablecontains at least one value, you can retrieve theComparatorwith:((SortedMap<C, V>) table.rowMap().values().iterator().next()).comparator();.Usetable.rowKeySet().comparator()instead.Use((NavigableSet<K>) multimap.keySet()).comparator()instead.UseTraverser.breadthFirst(N)instead, which has the same behavior.UseTraverser.depthFirstPostOrder(N)instead, which has the same behavior.UseTraverser.depthFirstPreOrder(N)instead, which has the same behavior.UseTraverser.forTree(com.google.common.graph.SuccessorsFunction<N>)instead. If you are using a lambda, these methods have exactly the same signature.Unsupported operation.Unsupported operation.Unsupported operation.no need to use thisno need to use thisno need to use thisProvided only to satisfy thePredicateinterface; useBloomFilter.mightContain(T)instead.This returnsObject.hashCode(); you almost certainly mean to callhash().asInt().If you must interoperate with a system that requires MD5, then use this method, despite its deprecation. But if you can choose your hash function, avoid MD5, which is neither fast nor secure. As of January 2017, we suggest:- For security:
Hashing.sha256()or a higher-level API. - For speed:
Hashing.goodFastHash(int), though see its docs for caveats.
This implementation produces incorrect hash values from theHashFunction.hashString(java.lang.CharSequence, java.nio.charset.Charset)method if the string contains non-BMP characters. UseHashing.murmur3_32_fixed()instead.This implementation produces incorrect hash values from theHashFunction.hashString(java.lang.CharSequence, java.nio.charset.Charset)method if the string contains non-BMP characters. UseHashing.murmur3_32_fixed(int)instead.If you must interoperate with a system that requires SHA-1, then use this method, despite its deprecation. But if you can choose your hash function, avoid SHA-1, which is neither fast nor secure. As of January 2017, we suggest:- For security:
Hashing.sha256()or a higher-level API. - For speed:
Hashing.goodFastHash(int), though see its docs for caveats.
This method is dangerous as it discards the high byte of every character. For UTF-8, usewrite(s.getBytes(StandardCharsets.UTF_8)).PreferasCharSink(to, charset, FileWriteMode.APPEND).write(from). This method is scheduled to be removed in October 2019.PreferasCharSource(from, charset).copyTo(to). This method is scheduled to be removed in October 2019.For Android users, see the Data and File Storage overview to select an appropriate temporary directory (perhapscontext.getCacheDir()). For developers on Java 7 or later, useFiles.createTempDirectory(java.nio.file.Path, java.lang.String, java.nio.file.attribute.FileAttribute<?>...), transforming it to aFileusingtoFile()if needed.PreferasByteSource(file).hash(hashFunction). This method is scheduled to be removed in October 2019.PreferasByteSource(file).read(processor). This method is scheduled to be removed in October 2019.PreferasCharSource(file, charset).readFirstLine(). This method is scheduled to be removed in October 2019.PreferasCharSource(file, charset).readLines(callback). This method is scheduled to be removed in October 2019.PreferasCharSource(file, charset).read(). This method is scheduled to be removed in October 2019.PreferasCharSink(to, charset).write(from). This method is scheduled to be removed in October 2019.The semantics ofwriteBytes(String s)are considered dangerous. Please useLittleEndianDataOutputStream.writeUTF(String s),LittleEndianDataOutputStream.writeChars(String s)or another write method instead.UseStats.meanOf(java.lang.Iterable<? extends java.lang.Number>)instead, noting the less strict handling of non-finite values.UseStats.meanOf(java.lang.Iterable<? extends java.lang.Number>)instead, noting the less strict handling of non-finite values.UseStats.meanOf(java.lang.Iterable<? extends java.lang.Number>)instead, noting the less strict handling of non-finite values.UseStats.meanOf(java.lang.Iterable<? extends java.lang.Number>)instead, noting the less strict handling of non-finite values.UseStats.meanOf(java.lang.Iterable<? extends java.lang.Number>)instead, noting the less strict handling of non-finite values.unsupported operationunsupported operationunsupported operationunsupported operationunsupported operationunsupported operationCreatingFutures of closeable types is dangerous in general because the underlying value may never be closed if theFutureis canceled after its operation begins. Consider replacing code that createsListenableFutures of closeable types, including those that pass them to this method, withClosingFuture.submit(ClosingCallable, Executor)in order to ensure that resources do not leak. Or, to start a pipeline with aListenableFuturethat doesn't create values that should be closed, useClosingFuture.from(com.google.common.util.concurrent.ListenableFuture<V>).no need to use this - For security:
-
Deprecated Enum ConstantsEnum ConstantDescriptionThis property was deprecated in Java 8 and removed in Java 9. We do not plan to remove this API from Guava, but if you are using it, it is probably not doing what you want.
com.google.common.util.concurrent. Please useForwardingBlockingDequeinstead.