2 * Copyright (C) 2015 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.api
.service
.dto
;
11 import java
.io
.Serializable
;
13 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
20 public class CdmEntityIdentifier
implements Serializable
{
23 private static final long serialVersionUID
= 1479948194282284147L;
27 private final Class
<?
extends CdmBase
> cdmClass
;
29 public CdmEntityIdentifier(int id
, Class cdmClass
) {
31 this.cdmClass
= cdmClass
;
39 public Class
getCdmClass() {
44 public boolean equals(Object obj
) {
45 if(obj
== null || !(obj
instanceof CdmEntityIdentifier
)) {
52 CdmEntityIdentifier that
= (CdmEntityIdentifier
) obj
;
53 if(this.cdmClass
.equals(that
.cdmClass
) && this.id
== that
.id
) {
61 public int hashCode() {
62 return (this.cdmClass
.getName() + String
.valueOf(this.id
)).hashCode();
66 public String
toString() {
67 return this.cdmClass
.getName() + String
.valueOf(this.id
);