Merge pull request #9251 from seratch/issue-12065

This commit is contained in:
Dale Wijnand 2020-10-22 11:34:16 +01:00 committed by GitHub
commit 6e96b92df4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -383,14 +383,29 @@ trait SpecificIterableFactory[-A, +C] extends Factory[A, C] {
*/
trait MapFactory[+CC[_, _]] extends Serializable {
/**
* An empty Map
*/
def empty[K, V]: CC[K, V]
/**
* A collection of type Map generated from given iterable object.
*/
def from[K, V](it: IterableOnce[(K, V)]): CC[K, V]
/**
* A collection of type Map that contains given key/value bindings.
*/
def apply[K, V](elems: (K, V)*): CC[K, V] = from(elems)
/**
* The default builder for Map objects.
*/
def newBuilder[K, V]: Builder[(K, V), CC[K, V]]
/**
* The default Factory instance for maps.
*/
implicit def mapFactory[K, V]: Factory[(K, V), CC[K, V]] = MapFactory.toFactory(this)
}