All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.avivcarmis.confEager.properties.utils.ConfEagerValueMapper Maven / Gradle / Ivy

Go to download

Super simplistic and dynamic eager-initialization configuration library for Java.

The newest version!
package io.github.avivcarmis.confEager.properties.utils;

public interface ConfEagerValueMapper {

    OUTPUT map(String input);

    ConfEagerValueMapper STRING_MAPPER = input -> input;

    ConfEagerValueMapper BOOLEAN_MAPPER = input -> {
        if (input.trim().equals("true")) {
            return true;
        }
        if (input.trim().equals("false")) {
            return false;
        }
        throw new IllegalArgumentException("boolean cannot be parsed from: " + input);
    };

    ConfEagerValueMapper INTEGER_MAPPER = Integer::valueOf;

    ConfEagerValueMapper LONG_MAPPER = Long::valueOf;

    ConfEagerValueMapper FLOAT_MAPPER = Float::valueOf;

    ConfEagerValueMapper DOUBLE_MAPPER = Double::valueOf;

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy