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

io.tracee.configuration.PropertyChain Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
package io.tracee.configuration;

import java.util.Arrays;
import java.util.Properties;

public class PropertyChain {

	private final Iterable propertiesChain;

	public PropertyChain(Iterable propertiesChain) {
		this.propertiesChain = propertiesChain;
	}

	public static PropertyChain build(Properties... properties) {
		return new PropertyChain(Arrays.asList(properties));
	}


	public String getProperty(String key) {
		for (Properties properties : propertiesChain) {
			final String p = properties.getProperty(key);
			if (p != null)
				return p;
		}
		return null;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy