ChickenDB is a basic in-memory database. Basically a HashMap with some useful features.
ChickenDB<String, User> db = new ChickenDB<>();
/**
* This Filter helps to find all User with the given Status
*/
public class StatusFilter implements IFilter<User> {
private Status status;
/**
* @param status The given status
*/
public StatusFilter(Status status) {
this.status = status;
}
/**
* Validator method
*/
@Override
public boolean validate(User item) {
return item.getStatus() == status;
}
}
ChickenDB<String, User> result = db.filter(new StatusFilter(Status.ONLINE))
.filter(/* Other filter... */);
ChickenDB<String, User> result = db.filter(user -> user.getStatus() == Status.ONLINE)
.filter(/* Other filter... */);
Soon...