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

io.github.vipcxj.jasync.ng.runtime.context.Context0Map Maven / Gradle / Ivy

package io.github.vipcxj.jasync.ng.runtime.context;

import java.util.Set;

public class Context0Map implements ContextMap {

    public static final ContextMap EMPTY = new Context0Map();

    private final Set keys = new ContextMapKeySet();

    private Context0Map() {}

    @Override
    public  T get(Object key) {
        ContextMap.checkKey(key);
        return null;
    }

    @Override
    public boolean hasKey(Object key) {
        ContextMap.checkKey(key);
        return false;
    }

    @Override
    public int size() {
        return 0;
    }

    @Override
    public ContextMap put(Object key, Object value) {
        ContextMap.checkKey(key);
        return new Context1Map(key, value);
    }

    @Override
    public ContextMap remove(Object key) {
        ContextMap.checkKey(key);
        return this;
    }

    @Override
    public Set keys() {
        return keys;
    }
}