Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.datenstrudel.bulbs.shared.domain.model;
 

Parameters:
<T> implementing class type
<ID> Type of Id
Author(s):
Thomas Wendzinski
public abstract class Entity<T extends Entity, ID> extends IdentifiedDomainObject<ID> 
        implements Serializable {
    //~ Member(s) //////////////////////////////////////////////////////////////
    //~ Construction ///////////////////////////////////////////////////////////
    public Entity() {
    }
    public Entity(ID id) {
        super(id);
    }
    //~ Method(s) //////////////////////////////////////////////////////////////
    
Entities compare by identity, not by attributes.

Parameters:
other The other entity.
Returns:
true if the identities are the same, regardles of other attributes.
    public boolean sameIdentityAs(T other){
        if(other == nullreturn false;
        return this.getId().equals(other.getId());
    }
    //~ Private Artifact(s) ////////////////////////////////////////////////////
New to GrepCode? Check out our FAQ X