package com.nmf.model.security;

import com.nmf.model.CacheKey;

import java.io.Serializable;

public class SecurityKey implements Serializable, CacheKey {
    private static final long serialVersionUID = 0L;

    private long id;

    public SecurityKey() {
        // No-op.
    }

    public SecurityKey(
        long id
    ) {
        this.id = id;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Override public boolean equals(Object o) {
        if (this == o)
            return true;

        if (!(o instanceof SecurityKey))
            return false;

        SecurityKey that = (SecurityKey)o;

        if (id != that.id)
            return false;

        return true;
    }

    @Override public int hashCode() {
        int res = (int)(id ^ (id >>> 32));

        return res;
    }

    @Override public String toString() {
        return "SecurityKey [id=" + id +
            "]";
    }
}

