Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bxb100/fava

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fava - advanced functional Java

JDK 11+

Using Java Profile JProfile

Java Lambda: Method Reference

Copy From Article

Type Syntax Lambda
Reference to a static method ClassName::staticMethodName (args) -> ClassName.staticMethodName(args)
Reference to an instance method of an existing object object::instanceMethodName (args) -> object.instanceMethodName(args)
Reference to an instance method of an arbitrary object of a particular type ClassName::instanceMethodName (arg0,rest) -> arg0.instanceMethodName(rest) Note: argo is of type ClassName
Reference to a constructor ClassName::new (args) -> new ClassName(args)

Lambda Examples

@FunctionalInterface
public interface IF2<T1, T2, R> {
	R apply(T1 t1, T2 t2);
}

means two input parameters and one output parameter

(a, b) -> a.split(b)1 equals IF2<String, String, String[]> if2 = String::split

Other

Test with Spock


About

Fava - advanced functional Java.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 97.0%
  • Groovy 3.0%