🤹 Noel's Java/Kotlin Utilities
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.
Utilities
commons-java-utils
java-utils adds some additional utilities for Java-related programming.
SetOnce
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"
Content copied to clipboard
#
#
#
#
#
Installation
Gradle
Kotlin DSL
repositories {
maven {
url = uri("https://maven.floofy.dev/repo/releases")
}
}
dependencies {
implementation("dev.floofy.commons:<package>:<VERSION>")
}
Content copied to clipboard
Groovy DSL
repositories {
maven {
url "https://maven.floofy.dev/repo/releases"
}
}
dependencies {
implementation "dev.floofy.commons:<package>:<VERSION>"
}
Content copied to clipboard
Maven
<repositories>
<repository>
<id>noel-maven</id>
<url>https://maven.floofy.dev/repo/releases</url>
</repository>
</repositories>
Content copied to clipboard
<dependencies>
<dependency>
<groupId>dev.floofy.commons</groupId>
<artifactId>{{PACKAGE}}</artifactId>
<version>{{VERSION}}</version>
<type>pom</type>
</dependency>
</dependencies>
Content copied to clipboard
License
common-utils is released under the MIT License, with love by Noel. :3