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

org.wildfly.clustering.session.cache.attributes.SessionAttributes Maven / Gradle / Ivy

There is a newer version: 4.0.0.Final
Show newest version
/*
 * Copyright The WildFly Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package org.wildfly.clustering.session.cache.attributes;

import java.util.Map;

/**
 * @author Paul Ferraro
 */
public interface SessionAttributes extends Map, AutoCloseable {

	@Override
	default int size() {
		return this.keySet().size();
	}

	@Override
	default boolean isEmpty() {
		return this.keySet().isEmpty();
	}

	@Override
	default boolean containsKey(Object key) {
		return this.keySet().contains(key);
	}

	@Override
	default boolean containsValue(Object value) {
		return this.values().contains(value);
	}

	@Override
	default void putAll(Map map) {
		map.entrySet().stream().forEach(this::put);
	}

	default void put(Map.Entry entry) {
		this.put(entry.getKey(), entry.getValue());
	}

	@Override
	default void clear() {
		this.keySet().stream().forEach(this::remove);
	}

	@Override
	void close();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy