Skip to content

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.

screen shot 2016-02-22 at 8 44 42 pm # The Convertable Mixin

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

Examples

Convertable.fromSupplier(()->null).orElse(11)
//11

Convertable.fromSupplier(()->10).toAtomicReference()

//AtomicReference[10]

Convertable.fromSupplier(()->10).toList()

//List(10)
etc.

Used by

As of Cyclops 7.1.0 it is implemented by

Clone this wiki locally