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

info.unterrainer.commons.httpserver.daos.ParamMap Maven / Gradle / Ivy

There is a newer version: 0.3.14
Show newest version
package info.unterrainer.commons.httpserver.daos;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Singular;

@Data
@AllArgsConstructor
@Builder
public class ParamMap {

	@Singular
	private Map parameters;

	public ParamMap addParameter(final String parameterKey, final Object parameterValue) {
		parameters.put(parameterKey, parameterValue);
		return this;
	}

	public Object get(final String parameterKey) {
		return parameters.get(parameterKey);
	}

	public Set> entrySet() {
		return parameters.entrySet();
	}

	public Set keySet() {
		return parameters.keySet();
	}

	public Collection valueSet() {
		return parameters.values();
	}

	public boolean containsKey(final String parameterKey) {
		return parameters.containsKey(parameterKey);
	}

	public boolean containsValue(final Object parameterValue) {
		return parameters.containsValue(parameterValue);
	}

	public void clear() {
		parameters.clear();
	}

	@Override
	public ParamMap clone() {
		return new ParamMap(new HashMap(parameters));
	}
}