Common Java and Kotlin utilities personalized for myself. Comes with SLF4J, extensions for Kotlin/Koin/Gradle/Exposed, and more!
commons-utils is a Java and Kotlin library for handling utilities that I use in my projects.
java-utils adds some additional utilities for Java-related programming.
The SetOnce class lets an object be initialized once and can't be ever set again. It's useful if you wish to have values in your Java classes to be initialized only once and never again when your application is running.
private static final SetOnce<String> someString = new SetOnce<>();
someString.getValue(); // => throws IllegalStateException
someString.getValueOrNull(); // => `null`
someString.wasSet(); // => false
someString.setValue("hello"); // => void
someString.getValue(); // => "hello"
someString.getValueOrNull(); // => "hello"
someString.wasSet(); // => true
someString.setValue("world"); // => void
someString.getValue(); // => "hello"
repositories {
maven {
url = uri("https://maven.floofy.dev/repo/releases")
}
}
dependencies {
implementation("dev.floofy.commons:<package>:<VERSION>")
}
repositories {
maven {
url "https://maven.floofy.dev/repo/releases"
}
}
dependencies {
implementation "dev.floofy.commons:<package>:<VERSION>"
}
<repositories>
<repository>
<id>noel-maven</id>
<url>https://maven.floofy.dev/repo/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>dev.floofy.commons</groupId>
<artifactId>{{PACKAGE}}</artifactId>
<version>{{VERSION}}</version>
<type>pom</type>
</dependency>
</dependencies>
common-utils is released under the MIT License, with love by Noel. :3