A strongly-typed, immutable, simple alternative to Properties or Map<String, Object>
Find a file
dependabot[bot] da96233f8a
Bump junit-jupiter from 5.7.2 to 5.9.2
Bumps [junit-jupiter](https://github.com/junit-team/junit5) from 5.7.2 to 5.9.2.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.7.2...r5.9.2)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-10 21:02:48 +00:00
.github Upgrade to GitHub-native Dependabot (#16) 2021-04-30 11:10:56 +01:00
src Initial import 2020-04-06 16:12:12 +01:00
pom.xml Bump junit-jupiter from 5.7.2 to 5.9.2 2023-01-10 21:02:48 +00:00
README.md Initial import 2020-04-06 16:12:12 +01:00

TypedProperties

Sonatype Nexus (Release) Maven Central

Java 8 Java 11 Java 13 Java 14

A strongly-typed, immutable, simple alternative to Properties or, sanity-save-you, Map<String, Object>.

Usage

import net.kemitix.properties.typed.TypedProperties;
import net.kemitix.properties.typed.TypedProperty;

class Usage {
  public static void main(String[] args){
    // Create a new instance
    TypedProperties properties = TypedProperties.create();

    // Set a value - creates a new instance - immutability
    // parameters: key, value
    // - key is a class/interface, that extends TypedProperty<T>,
    //   where T is the type of the value.
    // - value is of type T
    TypedProperties updated = properties.with(Name.class, "Name");

    // Retrieve a value
    // parameters: key, value-type
    // - key is same as above
    // - value-type is the type of the value - must match key
    Optional<String> result = updated.find(Name.class, String.class);
  }
}
public interface Name
  extends TypedProperty<String> {}