Skip to content
A library of useful Java classes with built-in validations.
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
src
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
checks.xml
pom.xml

README.md

molecules

Build Status Quality Gate Status

A library of useful Java classes. You can use them as part of your entities, too.

what is it all about?

Think about a person. Now try to make a Person class. I guess you would craft something like this:

public class Person {
    private String firstName;
    private String lastName;
    private Date birthDate;
    private String email;    
}

Can you see that we have these properties: name and email address, but we have to map them to types like String, Date, etc. And do not forget about validating this data in the service layer....

So instead of these, why can't we have Name or Email types? And these types should know what is a valid email address or what is the maximum length of a name.

By using molecules, your Person class could look like this:

public class Person {
    private Name firstName;
    private Name lastName;
    private BirthDate birthDate;
    private Email email;    
}

Isn't it better? :)

Do you like the idea? Check out all the molecules or help! :)

what molecules are available?

Currently, these molecules are available within the following packages:

how to use them?

Well, at the moment you can clone or download this repository, build it and you can install it as a third party package. Later on, I'm planning to upload it as an artifact to the Maven Central Repository.

You can’t perform that action at this time.