JINQ
Java INtegrated Query in parlance with LINQ is an ultra minimalistic library for Java inspired from and mimicking the .NET LINQ. While LINQ is a language construct, JINQ is composed of types - classes and methods, but to the same effect.
Install / Use
/learn @vivekragunathan/JINQREADME
JINQ
Java INtegrated Query in parlance with LINQ is an ultra minimalistic library for Java inspired from and mimicking the .NET LINQ. While LINQ is a language construct, JINQ is composed of types - classes and methods, but to the same effect.
JINQ allows you to rewrite conventional and nested loop based data processing code into query oriented and highly readable code.
Here is a typical loop based data processing code:
List<ProductDisplayInfo> getDisplayList(Product[] products) {
List<ProductDisplayInfo> pdiList = new ArrayList<>();
for (int index = 0; index < products.length; ++index) {
Product p = products[index];
if (product.getCategory() == 2 || product.getCategory() == 5) {
boolean yes = isProductUnderDiscount(product);
if (!yes) {
ProductDisplayInfo pdi = new ProductDisplayInfo();
// whatever you want to populate pdi with ...
pdiList.add(pdi);
}
}
}
return pdiList;
}
Here is a C# LINQ snippet:
var query = from p in products
where p.getCategory == 2 || p.getCategory == 5 && isProductUnderDiscount(p)
select new ProductDisplayInfo(p);
var pdiList = query.ToList();
Here is JINQ in action:
final Iterable<ProductDisplayInfo> query = new Enumerable<>(products)
.where(p -> p.getCategory == 2 || p.getCategory == 5 && isProductUnderDiscount(p))
.select(p -> { new ProductDisplayInfo(p); } ); // or select(ProductDisplayInfo::new);
final List<ProductDisplayInfo> pdiList = query.toList();
or
for (ProductDisplayInfo pdi : pdiList) {
System.out.println(pdi);
}
Elaboration of JINQ is in progress. Until then you can try the related blog post.
Related Skills
node-connect
335.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
335.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.7kCommit, push, and open a PR
