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

org.codegas.commons.domain.entity.DomainEntity Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package org.codegas.commons.domain.entity;

import org.codegas.commons.lang.value.Id;

import java.util.Objects;

public abstract class DomainEntity {

    @Override
    public boolean equals(Object object) {
        return object != null &&
            getClass().equals(object.getClass()) &&
            Objects.equals(getId(), DomainEntity.class.cast(object).getId());
    }

    @Override
    public int hashCode() {
        return getId().hashCode();
    }

    public abstract T getId();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy