/**
 **
 ** FilterProperties.java - Properties container for tile filter configuration
 **
 ** Copyright (C) 2026 Elphel, Inc.
 **
 ** -----------------------------------------------------------------------------**
 **
 **  FilterProperties.java is free software: you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License as published by
 **  the Free Software Foundation, either version 3 of the License, or
 **  (at your option) any later version.
 **
 **  This program is distributed in the hope that it will be useful,
 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 **  GNU General Public License for more details.
 **
 **  You should have received a copy of the GNU General Public License
 **  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ** -----------------------------------------------------------------------------**
 **
 */
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;
	}

}
