@Override public int hashCode() { if (entityId.getEntityType().equals(EntityType.ARTIFACT)) { ArtifactId artifactId = (ArtifactId) entityId; return Objects.hash(artifactId.getEntityType(), artifactId.getNamespace(), artifactId.getArtifact()); } if (entityId.getEntityType().equals(EntityType.APPLICATION)) { ApplicationId applicationId = (ApplicationId) entityId; return Objects.hash(applicationId.getEntityType(), applicationId.getNamespace(), applicationId.getApplication()); } if (entityId.getEntityType().equals(EntityType.PROGRAM)) { ProgramId programId = (ProgramId) entityId; return Objects.hash(programId.getEntityType(), programId.getNamespace(), programId.getApplication(), programId.getType(), programId.getProgram()); } return Objects.hash(entityId); } }