Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
グアバでは、私がCollection<T>-を持っている場合、それを簡単に変換できるグアバの既存の関数はありますCollection<Optional<T>>か?
Collection<T>
Collection<Optional<T>>
通常の方法のみ:
return Collections.transform(collection, new Function<T, Optional<T>>() { public Optional<T> apply(T t) { return Optional.of(t); } }
..明示的で厳密な構造でそれを行う方がおそらく良いでしょうが。