0
I Use This!
Activity Not Available

Project Summary

jFluent is a little and simple library that provides a fluent layer over the java.util, java.lang and JDBC packages.

The library is in ALPHA stage, so if you want the very last version just check out the sources from the repository.

Now you can operate on lists and strings like that:

import static com.jfluent.builders.BuilderFacade.*;
import com.jfluent.base.*;

public class FluentSimpleTest {
public static void main(String[] args) {
string("o hai!")
.append(" ")
.append(
list("i", "can", "has", "cheezburger", "plz", "?")
.map(new Function() {
public String apply(String element) {
return element + " ";
}
})
.get())
.append("\n")
.append(
list(range('A', 'Z'))
.reverse()
.filter(new Predicate() {
public boolean apply(Character c) {
return c > 'M';
}
})
.join(","))
.println(System.out);
}
}Output:

o hai! i can has cheezburger plz ?
Z,Y,X,W,V,U,T,S,R,Q,P,O,NAlso, a fluent approach over jdbc is possible:

import static com.jfluent.builders.BuilderFacade.*;
import com.jfluent.db.base.Handle;
import java.util.List;

public final class DBFluentTest {
public static void main(String[] args) throws Exception {
Handle empList = param();

withConnection(JDBC_URI_HERE)
.username("scott")
.password("tiger")
.loadOracleDriver()
.doThis(
procedure("package1.open_cur_emp") // call this procedure
.outRS(empList, EmpBean.class) // put the resultset into a list of beans
.in(nullObj(Integer.class))); // passing a null integer as input

for (Object o : empList.value()) {
EmpBean e = (EmpBean)o;
// do something with your list of entity beans
}
}
}For more info on fluent interfaces and DSLs, the work in progress book by Martin Fowler is a good starting point. It can be found here: http://martinfowler.com/dslwip/

I'd like to hear opinions and suggestions for improvements! Contact me at martinelli.diego at gmail.com

Tags

collections dsl fluent interface java jdbc jfluent list oracle string util

In a Nutshell, jfluent...

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

MIT License
Permitted

Sub-License

Private Use

Commercial Use

Modify

Distribute

Forbidden

Hold Liable

Required

Include Copyright

Include License

These details are provided for information only. No information here is legal advice and should not be used as such.

All Licenses

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    anyone with an Open Hub account can update a project's tags
  • ...
    there are over 3,000 projects on the Open Hub with security vulnerabilities reported against them
  • ...
    data presented on the Open Hub is available through our API

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

Community Rating

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!
Sample ohloh analysis