/************************************************
 * Copyright (c) Shen Li. All rights reserved.  *
 * http://joyaop.sourceforge.net                *
 * -------------------------------------------- *
 * Distributable under LGPL license.            *
 * See terms of license at gnu.org.             *
 ************************************************/
package net.sf.joyaop.demo.rbac.model;

/**
 * @author Shen Li
 */
public class Entity {
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {              
        this.id = id;
    }

    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (object == null) {
            return false;
        }
        if (getClass() != object.getClass()) {
            return false;
        }
        if (id == null) {
            return false;
        }
        if (id.equals(((Entity) object).getId())) {
            return true;
        }
        return false;
    }

    public int hashCode() {
        return (id == null ? super.hashCode() : id.hashCode());
    }

    public String toString() {
        return getClass().getName() + "(ID=" + id + ")"; 
    }
}
