Groovy Documentation

com.github.mperry.fg
[Groovy] Class EitherExtension

java.lang.Object
  com.github.mperry.fg.EitherExtension

@groovy.transform.TypeChecked
class EitherExtension

Created with IntelliJ IDEA. User: PerryMa Date: 30/11/12 Time: 1:45 PM To change this template use File | Settings | File Templates.


Method Summary
static Either bind(Either either, groovy.lang.Closure f)

Binds over the right value

static Either collect(Either either, groovy.lang.Closure f)

static Either collectMany(Either either, groovy.lang.Closure f)

static Option filter(Either e, groovy.lang.Closure f)

Copies the FunctionalJava Either.filter and Validation.filter method, implemented as filterEither

static Option filterEither(Either e, groovy.lang.Closure f)

Same as Validation.filter.

static Either filterRight(Either e, groovy.lang.Closure f)

static Option findAll(Either e, groovy.lang.Closure f)

static Either map(Either either, groovy.lang.Closure f)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

bind

@groovy.transform.TypeChecked
static Either bind(Either either, groovy.lang.Closure f)
Binds over the right value


collect

@groovy.transform.TypeChecked(TypeCheckingMode.SKIP)
static Either collect(Either either, groovy.lang.Closure f)


collectMany

@groovy.transform.TypeChecked(TypeCheckingMode.SKIP)
static Either collectMany(Either either, groovy.lang.Closure f)


filter

@groovy.transform.TypeChecked(TypeCheckingMode.SKIP)
static Option filter(Either e, groovy.lang.Closure f)
Copies the FunctionalJava Either.filter and Validation.filter method, implemented as filterEither
Parameters:
e
f
Returns:


filterEither

@groovy.transform.TypeChecked(TypeCheckingMode.SKIP)
static Option filterEither(Either e, groovy.lang.Closure f)
Same as Validation.filter. Returns None if this is a failure or if the given predicate f does not hold for the success value, otherwise, returns a success in Some.
Parameters:
e
f
Returns:


filterRight

@groovy.transform.TypeChecked(TypeCheckingMode.SKIP)
static Either filterRight(Either e, groovy.lang.Closure f)


findAll

@groovy.transform.TypeChecked(TypeCheckingMode.SKIP)
static Option findAll(Either e, groovy.lang.Closure f)


map

@groovy.transform.TypeChecked(TypeCheckingMode.SKIP)
static Either map(Either either, groovy.lang.Closure f)


 

Groovy Documentation