It's a simple manager of "records" in a text file of CSV, JSON, etc. format. It's something you would use when you don't want to run a full database, but just a list of lines in a file is not enough. You need a file with structured records.
You add this to your pom.xml:
<dependency>
<groupId>com.yegor256</groupId>
<artifactId>tojos</artifactId>
<version>0.19.1</version>
</dependency>Then, to manage books.csv file:
import com.yegor256.tojos.MnCsv;
import com.yegor256.tojos.TjDefault;
import com.yegor256.tojos.Tojo;
import com.yegor256.tojos.Tojos;
Tojos tojos = new TjDefault(new MnCsv("books.csv"));
Tojo t1 = tojos.add("Object Thinking"); // unique ID
t1.set("author", "David West");
Tojo t2 = tojos.select(
t -> t.get("author").equals("David West")
).get(0);Each record has a unique ID, which is also the first column.
Fork repository, make changes, send us a pull request.
We will review your changes and apply them to the master branch shortly,
provided they don't violate our quality standards. To avoid frustration,
before sending us your pull request please run full Maven build:
mvn clean install -PquliceYou will need Maven 3.3+ and Java 8+.
We use JQF for fuzz testing. It helps us find inputs for some of our tests which are not obvious, but they still break the code. Here is how you can run it:
mvn test jqf:fuzzIf after this step you see any files in the
target/fuzz-results/com.yegor256.tojos.Fuzzing/fuzzMnTabs/failures/
directory, you got a few failures, very good!
Now, you reproduce them in order to understand what's wrong:
mvn jqf:repro -Dinput=target/fuzz-results/com.yegor256.tojos.Fuzzing/fuzzMnTabs/failures/id_000000You should see a stack trace and a few lines of code that caused the failure.