The most basic in-memory database in the world.
Because for test code I needed a data structure where I could easily store DTO's (or just any object) and get them out again in various ways with the least amount of hassle.
Of course, we have maps and lists and sets and everything, but this project treats DTO's more like database rows. You can do SELECT, INSERT, DELETE and UPDATE, by using functions. Hence "DTO Database."
It's incredibly basic, anybody could make it in an hour. Well, I saved you that hour.
(This is all taken from the unit tests.)
DtoTable<Address> addressTable = new DtoTable<>()
Subclass it if you like to add more methods.
addressTable.insert(address1, address2)
Duplicates (objects which are equals
) will be ignored
Set<Address> selected = addressTable.select(r -> r.number > 50)
This is the big advantage of Dtotabase: quickly select data in any way you like with just a simple lambda expression.
addressTable.update(
address -> address.number > 50,
address -> address.number *= 2)
addressTable.delete(r -> r.name.contains("lane"))
There may not be much activity since this project is very small, but I do intend to support it. Do report issues when you like more features or find bugs.