2 * Copyright (C) 2017 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
.vaadin
.model
;
11 import org
.apache
.commons
.lang
.builder
.HashCodeBuilder
;
14 * @author a.kohlbecker
18 public class TypedEntityReference
<T
> extends EntityReference
{
24 public TypedEntityReference(Class
<T
> type
, int id
, String label
) {
32 public Class
<T
> getType() {
37 * @param type the type to set
39 public void setType(Class
<T
> type
) {
43 private Class
<T
> type
;
51 public int hashCode() {
52 return new HashCodeBuilder(17, 31)
53 .appendSuper(super.hashCode())
54 .appendSuper(type
.hashCode())
61 @SuppressWarnings("rawtypes")
63 public boolean equals(Object obj
) {
65 TypedEntityReference other
= (TypedEntityReference
) obj
;
66 return id
== other
.id
&& label
.equals(other
.label
) && type
.equals(other
.type
);
68 } catch (Exception e
) {