-
Notifications
You must be signed in to change notification settings - Fork 51
cyclops closures : Convertable mixin
johnmcclean-aol edited this page Feb 24, 2016
·
3 revisions
Cyclops has merged with simple-react. Please update your bookmarks (stars :) ) to https://github.com/aol/cyclops-react
All new develpoment on cyclops occurs in cyclops-react. Older modules are still available in maven central.

Convertable is an interface that allows the conversion of a single nullable value into the following types (as of Cyclops 7.1.0)
- Optional
- AtomicReference
- Stream
- List
- Iterator
Convertable.fromSupplier(()->null).orElse(11)
//11
Convertable.fromSupplier(()->10).toAtomicReference()
//AtomicReference[10]
Convertable.fromSupplier(()->10).toList()
//List(10)
etc.
As of Cyclops 7.1.0 it is implemented by