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

com.maxifier.mxcache.clean.ClassCacheIds Maven / Gradle / Ivy

/*
 * Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
 */
package com.maxifier.mxcache.clean;

import com.maxifier.mxcache.caches.Cache;

import java.util.List;

/**
 * ClassCacheIds
 *
 * @author Andrey Yakoushin ([email protected])
 * @author Alexander Kochurov ([email protected])
 */
public final class ClassCacheIds {
    private final int[] instanceIds;
    private final int[] staticIds;

    public ClassCacheIds(int[] instanceIds, int[] staticIds) {
        this.instanceIds = instanceIds;
        this.staticIds = staticIds;
    }

    public int[] getInstanceIds() {
        return instanceIds;
    }

    public int[] getStaticIds() {
        return staticIds;
    }

    @SuppressWarnings({ "unchecked" })
    void appendInstanceCaches(Cleanable cleanable, Object instance, List list) {
        for (int id : instanceIds) {
            list.add(cleanable.getInstanceCache(instance, id));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy