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

com.mageddo.togglefirst.DefaultFeatureMetadata Maven / Gradle / Ivy

There is a newer version: 1.4.9
Show newest version
package com.mageddo.togglefirst;

import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

public class DefaultFeatureMetadata implements FeatureMetadata {

	private final Feature feature;
	private final Map parameters;

	public DefaultFeatureMetadata(Feature feature) {
		this(feature, new LinkedHashMap<>());
	}

	public DefaultFeatureMetadata(Feature feature, Map parameters) {
		this.feature = feature;
		this.parameters = new HashMap<>(parameters);
	}

	@Override
	public Feature feature() {
		return feature;
	}

	@Override
	public Map parameters() {
		return Collections.unmodifiableMap(parameters);
	}

	@Override
	public FeatureMetadata set(String k, String v){
		parameters.put(k, v);
		return this;
	}

	@Override
	public String get(String k){
		return parameters.get(k);
	}

	@Override
	public void remove(String k){
		parameters.remove(k);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy