Guava 19.0 RC1 发布,Google 的 Java 常用类库
腾讯SNG夏日招聘集结号:200个空缺岗位,JAVA、C++、云计算、Android……
Guava 19.0 RC1 发布,主要改进:
common.base
Added
CharMatcher
static factory methods equivalent to theCharMatcher
constants. For example, addedCharMatcher.whitespace()
which is equivalent toCharMatcher.WHITESPACE
. Eventually, the constants will be deprecated and removed.This is being done because using constants requires a large number of classes to be initialized when anything from
CharMatcher
is used; switching to static factory methods allows classes to be initialized only as needed for the type ofCharMatcher
actually being used.Added
Throwables.lazyStackTrace(Throwable)
- Returns aList<StackTraceElement>
that may load the stack trace elements lazily. Useful if you want to get only the first N elements of the stack trace efficiently.Added
lazyStackTraceIsLazy()
- Returns whether or not the above method is able to use the special implementation that makes it lazy on the current platform.Added
VerifyException
constructor overloads taking aThrowable
cause.
common.cache
This package has graduated from @Beta
, making it safe to use in library code.
Added visibility of
CacheLoader.UnsupportedLoadingOperationException
Added
RemovalNotification.create
These should only be needed if creating a custom cache implementation
common.collect
Added factory and builder methods for various ImmutableMap
s and ImmutableMultimap
s that take Iterable<Map.Entry>
.
Added
FluentIterable.toMultiset()
Added
RangeSet.asDescendingSetOfRanges()
andRangeMap.asDescendingMapOfRanges()
Added
Lists.cartesianProduct(List...)
andLists.cartesianProduct(List<List>>)
Added
Maps.newLinkedHashMapWithExpectedSize(int)
Re-added
Multisets.removeOccurrences(Multiset, Multiset)
which was (binary incompatibly) missing in 18.0 because it was replaced withMultisets.removeOccurences(Multiset, Iterable)
Deprecated
MapConstraint
andMapConstraints
Deprecated
Sets.newSetFromMap(Map)
- Java 6 providesCollections.newSetFromMap(Map)
Removed
MapMaker.softValues()
common.eventbus
Added
EventBus.identifier()
Removed protected method
AsyncEventBus.dispatchQueuedEvents()
(made package-private)
common.hash
Added
BloomFilter.create
overloads taking along
for theexpectedInsertions
Added
Hashing.sha384()
Added
Hashing.concatenating(HashFunction, HashFunction, HashFunction...)
andHashing.concatenating(Iterable<HashFunction>)
common.io
Added
ByteSource.sizeIfKnown()
Added
CharSource.length()
Added
CharSource.lengthIfKnown()
common.net
Added a couple new constants to
HttpHeaders
andMediaType
Updated public suffix list for
InternetDomainName
common.reflect
Added
TypeToken.isSubtypeOf(TypeToken)
,TypeToken.isSupertypeOf(TypeToken)
and overloads of both that take aType
Deprecated
TypeToken.isAssignableFrom(TypeToken)
andTypeToken.isAssignableFrom(Type)
-isSupertypeOf
provides equivalent behavior with a less confusing name
common.util.concurrent
Added
AbstractFuture.newCancellationCause()
Added
AbstractFuture.setFuture(ListenableFuture)
Added
Futures.getChecked
Added
Futures.catching
andFutures.catchingAsync
Added
Futures.transformAsync
Added
Futures.withTimeout
Deprecated
FutureFallback
andFutures.withFallback
methods - these are replaced withFutures.catching
Deprecated
Futures.get
methods taking aClass<X extends Exception>
- these are replaced withFutures.getChecked
Deprecated
Futures.transform
methods taking anAsyncFunction
- these are replaced withFutures.transformAsync
详细改进请看发行说明。
下载:https://github.com/google/guava/archive/v19.0-rc1.zip。
Guava | Guava (GWT) | |
---|---|---|
Maven Identifier | com.google.guava:guava:19.0-rc1 | com.google.guava:guava-gwt:19.0-rc1 |
Jar | guava-19.0-rc1.jar | guava-gwt-19.0-rc1.jar |
Javadoc | guava-19.0-rc1-javadoc.jar | guava-gwt-19.0-rc1-javadoc.jar |
Sources | guava-19.0-rc1-sources.jar | guava-gwt-19.0-rc1-sources.jar |
Guava 中文是石榴的意思,该项目是 Google 的一个开源项目,包含许多 Google 核心的 Java 常用库。
目前主要包含:
com.google.common.annotations
com.google.common.base
com.google.common.collect
com.google.common.io
com.google.common.net
com.google.common.primitives
com.google.common.util.concurrent
在线API doc:http://tool.oschina.net/apidocs/apidoc?api=guava