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

com.maxifier.mxcache.impl.CacheId Maven / Gradle / Ivy

Go to download

Constains all classes necessary for launching a MxCache-instrumentated application

There is a newer version: 2.6.9
Show newest version
/*
 * Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
 */
package com.maxifier.mxcache.impl;

import javax.annotation.Nonnull;

/**
 * @author Alexander Kochurov ([email protected])
 */
public final class CacheId {
    @Nonnull
    private final Class owner;

    private final int id;

    public CacheId(@Nonnull Class owner, int id) {
        this.owner = owner;
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        CacheId cacheId = (CacheId) o;

        return id == cacheId.id && owner == cacheId.owner;
    }

    @Override
    public int hashCode() {
        return 31 * owner.hashCode() + id;
    }

    @Override
    public String toString() {
        return "CacheId{owner=" + owner + ", id=" + id + '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy