Various utilities to be used as static imports in pseudocode and other non-serious applications. This repository acts as a database for Java tricks & general purpose helpful methods that can be imported statically.
Disclaimer: Do not use this in production applications.
(unless you are god c0dar who uses epic bools & voids on regular basis)
repositories {
mavenCentral()
}
dependencies {
implementation "dev.klepto.lazyvoids:lazyvoids:0.0.1"
}
Library contains both useful and not-so useful utilities. Since amount of utilities is going to expand over time, the list of features is unlikely to be updated. For more information, browse this repository.
Warning: Legendary voids
String number = "one";
int value = when(number)
.map("one", 1)
.map("two", 2)
.orElse(0); // returns 1
List<URL> fileUrls = Files.walk(directory)
.map(path -> runtimeThrows(() -> path.toUri().toURL()))
.collect(Collectors.toList());
public enum Item {
SIX_CONSOLES(1337),
GAMER_GUITAR(9001),
DOG_CAM(420);
@Getter private final int uid;
Item(int uid) {
this.uid = uid;
}
}
Map<Integer, Item> uidToItem = enumEntryMap(Item::getUid);
Happy voiding lads. If you have any nuclear ints make sure to create a pull request.
Nobody reads this bit.