delight-async-properties
Async Properties is a Java library to store and retrieve properties in an asynchronous manner.
Usage
Storing Properties
Properties are set using the record(operation)
method. All operations are performed asynchronously.
PropertyNode props = Properties.create(Properties.defaultFactory());
props.record(Properties.set("key", "value"));
props.stop().get();
Retrieving Properties
Properties can be retrieved using the retrieve(key)
method. retrieve(key)
returns a Promise which must be resolved using .get()
.
PropertyNode props = Properties.create(Properties.defaultFactory());
props.record(Properties.set("key", "value"));
System.out.println(props.retrieve("key").get());
props.stop().get();
Rendering All Properties
Renders all properties in a human-readable JSON representation.
PropertyNode props = Properties.create(Properties.defaultFactory());
props.record(Properties.set("key", "value"));
System.out.println(props.render().get());
props.stop().get();
Maven Dependency
<dependency>
<groupId>de.mxro.async.properties</groupId>
<artifactId>async-properties</artifactId>
<version>[latest version]</version>
</dependency>
This artifact is available on Maven Central and BinTray.
Compatibility
This project is compatible with the following environments:
- Java 1.6+
- GWT 2.5.0+
- Android (any)
- OSGi (any)