@@ -0,0 +1,2685 @@
+/*%0A * This file is part of NucleusFramework for Bukkit, licensed under the MIT License (MIT).%0A *%0A * Copyright (c) JCThePants (www.jcwhatever.com)%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in%0A * all copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN%0A * THE SOFTWARE.%0A */%0A%0Apackage com.jcwhatever.nucleus.utils;%0A%0Aimport com.jcwhatever.nucleus.mixins.IMeta;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport javax.annotation.Nullable;%0A%0A/**%0A * A meta data storage container.%0A */%0Apublic class MetaStore implements IMeta %7B%0A%0A    private final int _size;%0A    private Map%3CObject, Object%3E _meta;%0A%0A    /**%0A     * Constructor.%0A     *%0A     * %3Cp%3EInitializes with an initial capacity of 3.%3C/p%3E%0A     */%0A    public MetaStore() %7B%0A        this(3);%0A    %7D%0A%0A    /**%0A     * Constructor.%0A     *%0A     * @param size  The initial capacity.%0A     */%0A    public MetaStore(int size) %7B%0A        _size = size;%0A    %7D%0A%0A    @Nullable%0A    @Override%0A    public %3CT%3E T getMeta(MetaKey%3CT%3E key) %7B%0A        PreCon.notNull(key);%0A%0A        if (_meta == null)%0A            return null;%0A%0A        @SuppressWarnings(%22unchecked%22)%0A        T result = (T)_meta.get(key);%0A%0A        return result;%0A    %7D%0A%0A    @Nullable%0A    @Override%0A    public Object getMetaObject(Object key) %7B%0A        PreCon.notNull(key);%0A%0A        if (_meta == null)%0A            return null;%0A%0A        return _meta.get(key);%0A    %7D%0A%0A    @Override%0A    public %3CT%3E void setMeta(MetaKey%3CT%3E key, @Nullable T value) %7B%0A        PreCon.notNull(key);%0A%0A        if (_meta == null) %7B%0A            if (value == null)%0A                return;%0A%0A            _meta = new HashMap%3C%3E(_size);%0A        %7D%0A%0A        if (value == null) %7B%0A            _meta.remove(key);%0A        %7D%0A        else %7B%0A            _meta.put(key, value);%0A        %7D%0A    %7D%0A%7D%0A

add MetaStore