Release of Funcito version 1.3.0, supporting Command class and Safe Navigation mode

13 views
Skip to first unread message

kbwelker

unread,
Nov 4, 2013, 2:50:42 PM11/4/13
to jed...@googlegroups.com
I just released version 1.3.0 of Funcito, the OSS API that works with Jedi (and several other libraries with functional idiom APIs), to wrap method calls as
functional-objects.  It is at:

https://code.google.com/p/funcito/
     or for Maven Central:
http://search.maven.org/#artifactdetails|com.googlecode.funcito|funcito|1.3.0|jar

As a summary, Funcito helps eliminate some of the "vertical problem" inherent in creating Functions/Predicates as inner classes, instead using proxying technologies to wrap existing methods as functional-objects in concise, expressive and refactor-safe code, usually in a single clear line.

There are two primary features in this release that would be of interest to Jedi users: support for the Command object, and custom execution modes (especially SafeNav).

The first of these features is added support for Jedi Command.  See the website documentation for how to use factory methods to create your Jedi Command objects easily.

The second prominent feature would be the addition of the SafeNav mode, and the addition of execution modes in general.  All functional object factory methods have been overloaded to take an optional Mode or TypedMode that controls the execution.  The highlighted provided Mode, SafeNav, behaves very similarly to the Groovy safe-navigation operator, "?.", providing a short-hand null check for every segment in a method call chain, with a default return value of null if any segment evaluates to null.  In addition, you can explicitly provide a default value other than null.

As an example, instead of having to code for potential nulls as follows:

Functor<A,D> func = new Functor<A,D> {
   @Override
   public D execute(A a) {
      if (a!=null && a.b()!=null && a.b().c()!=null) {
         return a.b().c().d();
      }
   }
}

You could instead do:

Function<A,D> func = functorFor(callsTo(A.class), safeNav()).b().c().d()));


The complete list of 1.3.0 changes follows:
  • Support for Netflix RxJava framework, including both Func1 and Action1 types
  • "Command"-like functor support in Jedi, Functional Java, Collection-generic, Play!, and RxJava
  • Modes and TypedModes, including SafeNav (like the Groovy operator), TailDefault and others
  • Users can define and use their own custom modes
  • Mode and TypedMode versions of all factory methods
  • Alternative static access to set ProxyFactory (proxy provider)
  • ProxyFactory log message downgraded from warning to info
  • Upgraded Javadoc format (Java 7 generator)
  • upgrade of Gradle build to 1.6
  • improved tests and improved test coverage
  • upgraded Objenesis from 1.2 to 2.1
If are interested in contributing to the direction, features, or quality of Funcito, please contribute Issues on the project web site, or join the project Google group at: https://groups.google.com/group/funcito
Message has been deleted

Channing Walton

unread,
Nov 4, 2013, 5:57:22 PM11/4/13
to Jedi
Nice!

I’m afraid Jedi is not being worked on anymore as we’ve moved to Scala these days. But, its still useful for Java projects.

On 4 Nov 2013, at 20:18, kbwelker <kandp...@gmail.com> wrote:

Slight typo in original.  Where the example safeNav() code said:

Function<A,D> func = functorFor(callsTo(A.class), safeNav()).b().c().d()));

it should have instead said:

Functor<A,D> func = functorFor(callsTo(A.class), safeNav()).b().c().d()));


--
You received this message because you are subscribed to the Google Groups "jedi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jedilib+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

kbwelker

unread,
Nov 4, 2013, 6:52:09 PM11/4/13
to jed...@googlegroups.com
Yes, I get the same response every time I post an upgrade :-)
I put Jedi in the first version of Funcito, so I just keep supporting it, for anybody still using it.
Thanks for the kudos.

Channing Walton

unread,
Nov 4, 2013, 7:08:00 PM11/4/13
to Jedi
:D sorry I forgot I had previously responded in the same way.

kbwelker

unread,
Nov 5, 2013, 11:03:18 AM11/5/13
to jed...@googlegroups.com
Slight typo in original (I should proofread my own posts better).  Where the example safeNav() code said:

Function<A,D> func = functorFor(callsTo(A.class), safeNav()).b().c().d()));

it should have instead said:

Functor<A,D> func = functorFor(callsTo(A.class)).b().c().d()), safeNav());
Reply all
Reply to author
Forward
0 new messages