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

cz.jalasoft.util.configuration.exception.PropertyNotFoundException Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package cz.jalasoft.util.configuration.exception;

import static cz.jalasoft.util.ArgumentAssertion.*;

/**
 * A runtime exception that identifies a situation when there
 * is no value for a given key in a configuration file.
 *
 * @author Honza Lastovicka
 */
public final class PropertyNotFoundException extends RuntimeException {

    private final String key;

    public PropertyNotFoundException(String key) {
        mustNotBeNullOrEmpty(key, "Property key must not be null or empty");

        this.key = key;
    }

    @Override
    public String getMessage() {
        return "No property found for key " + key;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy