io.quarkus.websockets.next.runtime.UserDataImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-websockets-next Show documentation
Show all versions of quarkus-websockets-next Show documentation
Implementation of the WebSocket API with enhanced efficiency and usability
package io.quarkus.websockets.next.runtime;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import io.quarkus.websockets.next.UserData;
final class UserDataImpl implements UserData {
private final ConcurrentMap data;
UserDataImpl() {
this.data = new ConcurrentHashMap<>();
}
@SuppressWarnings("unchecked")
@Override
public VALUE get(TypedKey key) {
return (VALUE) data.get(key.value());
}
@SuppressWarnings("unchecked")
@Override
public VALUE put(TypedKey key, VALUE value) {
return (VALUE) data.put(key.value(), value);
}
@SuppressWarnings("unchecked")
@Override
public VALUE remove(TypedKey key) {
return (VALUE) data.remove(key.value());
}
@Override
public void clear() {
data.clear();
}
@Override
public int size() {
return data.size();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy