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

com.firefly.net.tcp.codec.flex.stream.impl.LazyContextAttribute Maven / Gradle / Ivy

There is a newer version: 5.0.0-dev6
Show newest version
package com.firefly.net.tcp.codec.flex.stream.impl;

import com.firefly.net.tcp.codec.flex.stream.ContextAttribute;
import com.firefly.utils.concurrent.LazyInitProperty;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * @author Pengtao Qiu
 */
public class LazyContextAttribute implements ContextAttribute {

    protected LazyInitProperty> attributes = new LazyInitProperty<>();

    @Override
    public Map getAttributes() {
        return attributes.getProperty(ConcurrentHashMap::new);
    }

    @Override
    public void setAttribute(String key, Object value) {
        getAttributes().put(key, value);
    }

    @Override
    public Object getAttribute(String key) {
        return getAttributes().get(key);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy