Skip to content

Type Interfaces : Filterable

johnmcclean-aol edited this page Nov 22, 2016 · 1 revision

The Filterable interface

A Filterable represents a type that can be filtered (e.g. filtering a Maybe#some to get a Maybe#none if the predicate doesn't hold, or removing elements from a List).

In cyclops-react it has the following methods

  • filter : keep a value if the predicate holds otherwise filter it out
  • filterNot : keep a value/s if the predicate doesn't hold otherwise filter it out
  • notNull : keep a value if it is not null
  • ofType : keep a value if it is of a particular type

Example

ListX.of(1,2,3,null,4)
     .notNull();
//ListX[1,2,3,4]

Implementations

AnyMSeq, AnyMValue, CollectionX, CompletableFutureT, DequeX, Eval, EvalT, FeatureToggle, FilterableFunctor, FluentCollectionX, FluentSequenceX, FoldableTransformerSeq, FutureWT, Ior<ST,PT>, IterableFilterable, JoolManipulation, LazyFutureStream, ListT, ListX, MapX<K,V>, Maybe, MaybeT, MutableCollectionX, MutableSequenceX, OptionalT, PBagX, PersistentCollectionX, PMapX<K,V>, POrderedSetX, PQueueX, PSetX, PStackX, PVectorX, QueueX, ReactiveSeq, SetT, SetX, SortedSetX, Streamable, StreamableT, StreamT, TransformerValue, Try<T,X>, TryT<T,X>, WrappingFilterable, Xor<ST,PT>, XorT<ST,T>

Clone this wiki locally