i know folks are in the habit of chaining Builder invocations without ever storing the ref to the builder (so build() does the type binding). i notice that build() is <K1 extends K, V1 extends V> Cache<K1,V1> so you can create a Cache<DerivedKey,DerivedValue> from a CacheBuilder<Key,Value> - isn't it more typical to create a Builder of the specific Derived* types?
wondering what i'm missing since i would expect this:public static <K,V> CacheBuilder<K,V> newBuilder() { return new CacheBuilder<K,V>(); }to be easier to use than something like this:@SuppressWarnings("unchecked")private static <K,V> CacheBuilder<K,V> newCacheBuilder() { return (CacheBuilder<K,V>)CacheBuilder.newBuilder(); }
i know folks are in the habit of chaining Builder invocations without ever storing the ref to the builder (so build() does the type binding). i notice that build() is <K1 extends K, V1 extends V> Cache<K1,V1> so you can create a Cache<DerivedKey,DerivedValue> from a CacheBuilder<Key,Value> - isn't it more typical to create a Builder of the specific Derived* types?
--
guava-...@googlegroups.com
Project site: http://guava-libraries.googlecode.com
This group: http://groups.google.com/group/guava-discuss
This list is for general discussion.
To report an issue: http://code.google.com/p/guava-libraries/issues/entry
To get help: http://stackoverflow.com/questions/ask (use the tag "guava")