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

org.ctoolkit.services.common.NonFunctionalCache Maven / Gradle / Ivy

There is a newer version: 0.36
Show newest version
/*
 * Copyright (c) 2017 Comvai, s.r.o. All Rights Reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

package org.ctoolkit.services.common;

import net.sf.jsr107cache.Cache;
import net.sf.jsr107cache.CacheEntry;
import net.sf.jsr107cache.CacheException;
import net.sf.jsr107cache.CacheListener;
import net.sf.jsr107cache.CacheStatistics;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

/**
 * Non functional cache implementation. Behaves like an empty cache.
 *
 * @author Aurel Medvegy
 */
class NonFunctionalCache
        implements Cache
{
    @Override
    public boolean containsKey( Object key )
    {
        return false;
    }

    @Override
    public boolean containsValue( Object value )
    {
        return false;
    }

    @Override
    public Set entrySet()
    {
        return null;
    }

    @Override
    public boolean isEmpty()
    {
        return true;
    }

    @Override
    public Set keySet()
    {
        return null;
    }

    @Override
    public void putAll( Map t )
    {
    }

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

    @Override
    public Collection values()
    {
        return null;
    }

    @Override
    public Object get( Object key )
    {
        return null;
    }

    @Override
    public Map getAll( Collection keys ) throws CacheException
    {
        return null;
    }

    @Override
    public void load( Object key ) throws CacheException
    {
    }

    @Override
    public void loadAll( Collection keys ) throws CacheException
    {
    }

    @Override
    public Object peek( Object key )
    {
        return null;
    }

    @Override
    public Object put( Object key, Object value )
    {
        return null;
    }

    @Override
    public CacheEntry getCacheEntry( Object key )
    {
        return null;
    }

    @Override
    public CacheStatistics getCacheStatistics()
    {
        return null;
    }

    @Override
    public Object remove( Object key )
    {
        return null;
    }

    @Override
    public void clear()
    {
    }

    @Override
    public void evict()
    {
    }

    @Override
    public void addListener( CacheListener listener )
    {
    }

    @Override
    public void removeListener( CacheListener listener )
    {
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy