io.quarkus.websockets.next.UserData 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;
/**
* Mutable user data associated with a connection. Implementations must be thread-safe.
*/
public interface UserData {
/**
*
* @param
* @param key
* @return the value or {@code null} if no mapping is found
*/
VALUE get(TypedKey key);
/**
* Associates the specified value with the specified key. An old value is replaced by the specified value.
*
* @param
* @param key
* @param value
* @return the previous value associated with {@code key}, or {@code null} if no mapping exists
*/
VALUE put(TypedKey key, VALUE value);
/**
*
* @param
* @param key
*/
VALUE remove(TypedKey key);
int size();
void clear();
/**
* @param The type this key is used for.
*/
record TypedKey(String value) {
public static TypedKey forInt(String key) {
return new TypedKey<>(key);
}
public static TypedKey forLong(String key) {
return new TypedKey<>(key);
}
public static TypedKey forString(String key) {
return new TypedKey<>(key);
}
public static TypedKey forBoolean(String key) {
return new TypedKey<>(key);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy