package com.elphel.imagej.common;

import java.util.Properties;
import java.util.Set;

public class FilterProperties {
	public static Properties keep(
			Properties  properies,
			Set<String> keys) {
		Properties filtered_properties = new Properties();
		for (String key:keys) {
			if (properies.getProperty(key) != null) {
			filtered_properties.setProperty(key, properies.getProperty(key));
			}
		}
		return filtered_properties;
	}
	public static Properties remove(
			Properties  properies,
			Set<String> keys) {
		Properties filtered_properties = new Properties();
		for (String key:properies.stringPropertyNames()) {
			if (!keys.contains(key)) {
				filtered_properties.setProperty(key, properies.getProperty(key));
			}
		}
		return filtered_properties;
	}

}
