vavr-io/vavr

(Collection) factory methods

開放

#2,125 建立於 2017年10月8日

 (2 則留言) (4 個反應) (0 位負責人)Java (605 個分叉)batch import
!BACK-COMPATdesign/refactoring/improvementhelp wanted«vavr-collection»

倉庫指標

星標
 (5,390 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

We have too many methods called of. Because most collections are also functions, I want to simplify that.

  • of(T), of(T...)
  • ofAll(Iterable)
  • ofAll(Iterator) <-- this one might be needed because Iterator (and the upcoming TraversableOnce) will not be Iterable anymore

We need to take a look if ofXyz(Xyz) or fromXyz(Xyz) makes more sense, e.g.

  • fromEntries(j.u.Map.Entry...)
  • fromEntries(Iterable<? extends j.u.Map.Entry>)
  • etc.

Also we will have distinguished factory method names that will not build instances directly from the given method parameters (like of(T...) does for example).

  • Stream.iterate(seed, f)
  • Tree.recurse(seed, f)
  • ...

貢獻者指南