https://github.com/notjustanna/properties
Clean version of java.util.Properties, using new stuff like HashMaps and Generics.
https://github.com/notjustanna/properties
Last synced: 11 months ago
JSON representation
Clean version of java.util.Properties, using new stuff like HashMaps and Generics.
- Host: GitHub
- URL: https://github.com/notjustanna/properties
- Owner: NotJustAnna
- License: mit
- Created: 2018-07-17T12:10:17.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2023-11-30T13:36:14.000Z (over 2 years ago)
- Last Synced: 2025-01-02T03:46:17.746Z (over 1 year ago)
- Language: Java
- Size: 202 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Properties
Properties is a simple, clean implementation of java.util.Properties, using new stuff like ConcurrentHashMaps and Generics.
It is a drop-in replacement for java.util.Properties, and is fully compatible with it.
### Installation
[](https://maven.notjustanna.net/releases/net/notjustanna/properties)
#### Maven
```xml
notjustanna-repository-releases
NotJustAnna Repository
https://maven.notjustanna.net/releases
```
```xml
net.notjustanna
properties
1.0.0
```
#### Gradle Groovy
```groovy
maven {
url "https://maven.notjustanna.net/releases"
}
```
```groovy
dependencies {
implementation "net.notjustanna:properties:1.0.0"
}
```
#### Gradle Kotlin
```kotlin
maven {
url = uri("https://maven.notjustanna.net/snapshots")
}
```
```kotlin
dependencies {
implementation("net.notjustanna:properties:1.0.0")
}
```
#### SBT
```scala
resolvers +=
"notjustanna-repository-releases"
at "https://maven.notjustanna.net/releases"
```
```scala
libraryDependencies += "net.notjustanna" % "properties" % "1.0.0"
```
### Usage
#### Reading:
```java
// New Instance
Properties properties = new Properties();
// Load from File
Properties properties = Properties.fromFile(file);
//Load from String
Properties properties = Properties.fromString("url=localhost\nport=8080");
```
#### Writing:
```java
// Save as String
String toString = properties.storeToString("Test Properties");
// Write to file
properties.store(file, "Test Properties");
// Write to a writer
properties.store(writer, "Test Properties");
```
## License
The project is licensed under the [MIT License](https://choosealicense.com/licenses/mit/).