Kodo Kojo Property Configurer

Software factory done right

License

License

Categories

Categories

config Application Layer Libs Configuration
GroupId

GroupId

io.kodokojo
ArtifactId

ArtifactId

property-configurer
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

Kodo Kojo Property Configurer
Software factory done right
Project Organization

Project Organization

Kodo-kojo
Source Code Management

Source Code Management

https://github.com/kodokojo/property-configurer

Download property-configurer

How to add to project

<!-- https://jarcasting.com/artifacts/io.kodokojo/property-configurer/ -->
<dependency>
    <groupId>io.kodokojo</groupId>
    <artifactId>property-configurer</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.kodokojo/property-configurer/
implementation 'io.kodokojo:property-configurer:0.2.0'
// https://jarcasting.com/artifacts/io.kodokojo/property-configurer/
implementation ("io.kodokojo:property-configurer:0.2.0")
'io.kodokojo:property-configurer:jar:0.2.0'
<dependency org="io.kodokojo" name="property-configurer" rev="0.2.0">
  <artifact name="property-configurer" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.kodokojo', module='property-configurer', version='0.2.0')
)
libraryDependencies += "io.kodokojo" % "property-configurer" % "0.2.0"
[io.kodokojo/property-configurer "0.2.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.apache.commons : commons-lang3 jar 3.7

test (10)

Group / Artifact Type Version
junit : junit jar 4.12
org.junit.jupiter : junit-jupiter-api jar 5.0.1
org.junit.jupiter : junit-jupiter-engine jar 5.0.1
org.junit.jupiter : junit-jupiter-params jar 5.0.1
org.junit.vintage : junit-vintage-engine jar 4.12.1
org.junit.platform : junit-platform-launcher jar 1.0.1
org.junit.platform : junit-platform-runner jar 1.0.1
com.tngtech.java : junit-dataprovider jar 1.10.2
org.assertj : assertj-core jar 3.8.0
org.mockito : mockito-core jar 2.10.0

Project Modules

There are no modules declared in this project.

Kodo Kojo Logo


Kodo Kojo allows you to get a full out-of-the-box software factory.

This repository provide a small tool which allow us to configure our service and use those configuration in an smart and easy way. This little library is developed as a Java 9 module.

License

Kodo Kojo is licensed under GNU General Public License v3.

Stay tuned

Stay tuned by following us on:

Quickstart

Maven configuration

Add following dependency in your pom.xml :

<dependency>
    <groupId>io.kodokojo</groupId>
    <artifactId>property-configurer</artifactId>
    <version>0.2.0</version>
</dependency>

Use it

Create your Property configuration interface

Create an interface ApplicationConfiguration which will be used in your code :

interface ApplicationConfiguration extends PropertyConfig {
        @Key("elasticsearch.host")
        String elasticsearchHost();
        
        @Key(value = "elasticsearch.port", defaultValue = "9200")
        Integer elasticsearchPort();
}

In thos sample, we provide the value of method elasticsearchHost via the System Env elasticsearch_host. Create a PropertyResolver:

PropertyResolver resolver = new PropertyResolver(new SystemEnvValueProvider());
ApplicationConfiguration proxy = resolver.createProxy(ApplicationConfiguration.class);

And enjoy :

System.out.println("Elasticsearch host : " + proxy.elasticsearchHost());

Other property provider are available in this library, or you can provide yours implementing PropertyValueProvider interface.

Technology inside

We use the following tests tools:

Thanks to all those Open source projects which made such a project possible!

io.kodokojo

Kodo Kojo

Versions

Version
0.2.0
0.1.0