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

io.quarkus.websockets.next.runtime.UserDataImpl Maven / Gradle / Ivy

There is a newer version: 3.17.2
Show newest version
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