红联Linux门户
Linux帮助

Guava 19.0 RC1发布,Google的Java常用类库

发布时间:2015-07-25 09:35:14来源:红联作者:empast
Guava 19.0 RC1 发布,主要改进:

common.base

Added CharMatcher static factory methods equivalent to the CharMatcher constants. For example, added CharMatcher.whitespace() which is equivalent to CharMatcher.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 of CharMatcher actually being used.

Added Throwables.lazyStackTrace(Throwable) - Returns a List 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 a Throwable 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 ImmutableMaps and ImmutableMultimaps that take Iterable.

Added FluentIterable.toMultiset()

Added RangeSet.asDescendingSetOfRanges() and RangeMap.asDescendingMapOfRanges()

Added Lists.cartesianProduct(List...) and Lists.cartesianProduct(List>)

Added Maps.newLinkedHashMapWithExpectedSize(int)

Re-added Multisets.removeOccurrences(Multiset, Multiset) which was (binary incompatibly) missing in 18.0 because it was replaced with Multisets.removeOccurences(Multiset, Iterable)

Deprecated MapConstraint and MapConstraints

Deprecated Sets.newSetFromMap(Map) - Java 6 provides Collections.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 a long for the expectedInsertions

Added Hashing.sha384()

Added Hashing.concatenating(HashFunction, HashFunction, HashFunction...) and Hashing.concatenating(Iterable)

common.io

Added ByteSource.sizeIfKnown()

Added CharSource.length()

Added CharSource.lengthIfKnown()

common.net

Added a couple new constants to HttpHeaders and MediaType

Updated public suffix list for InternetDomainName

common.reflect

Added TypeToken.isSubtypeOf(TypeToken), TypeToken.isSupertypeOf(TypeToken) and overloads of both that take a Type

Deprecated TypeToken.isAssignableFrom(TypeToken) and TypeToken.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 and Futures.catchingAsync

Added Futures.transformAsync

Added Futures.withTimeout

Deprecated FutureFallback and Futures.withFallback methods - these are replaced with Futures.catching

Deprecated Futures.get methods taking a Class - these are replaced with Futures.getChecked

Deprecated Futures.transform methods taking an AsyncFunction - these are replaced with Futures.transformAsync

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

软件详情:https://github.com/google/guava/wiki/Release19

下载地址:https://github.com/google/guava/archive/v19.0-rc1.zip

来自:开源中国社区
文章评论

共有 2 条评论

  1. chaian 于 2015-07-27 11:32:33发表:

    不错的东东

  2. jiangfengwk 于 2015-07-27 10:31:43发表:

    hh