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

uk.autores.handling.Config Maven / Gradle / Ivy

There is a newer version: 11.0.35-beta
Show newest version
// Copyright 2023 https://github.com/autores-uk/autores/blob/main/LICENSE.txt
// SPDX-License-Identifier: Apache-2.0
package uk.autores.handling;

import java.util.Objects;

/**
 * Config item derived from {@link ResourceFiles#config()}.
 */
public final class Config {

    private final String key;
    private final String value;

    /**
     * Constructor with mandatory values.
     *
     * @param key name
     * @param value configuration value
     */
    public Config(String key, String value) {
        this.key = Objects.requireNonNull(key);
        this.value = Objects.requireNonNull(value);
    }

    /**
     * Key.
     *
     * @return configuration key name
     * @see ResourceFiles.Cfg#key()
     */
    public String key() {
        return key;
    }

    /**
     * Value.
     *
     * @return configuration value
     * @see ResourceFiles.Cfg#value()
     */
    public String value() {
        return value;
    }

    @Override
    public String toString() {
        return key + "=" + value;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy