io.zbus.transport.AttributeMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zbus Show documentation
Show all versions of zbus Show documentation
a lightweight yet powerful MQ and RPC to build service bus
package io.zbus.transport;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
public class AttributeMap {
private ConcurrentMap attributes = null;
@SuppressWarnings("unchecked")
public V attr(String key) {
if (this.attributes == null) {
return null;
}
return (V) this.attributes.get(key);
}
public void attr(String key, V value) {
if(value == null){
if(this.attributes != null){
this.attributes.remove(key);
}
return;
}
if (this.attributes == null) {
synchronized (this) {
if (this.attributes == null) {
this.attributes = new ConcurrentHashMap();
}
}
}
this.attributes.put(key, value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy