1 package org.splat.service.dto;
6 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
8 public class KnowledgeElementTypeDTO {
15 * Persistent id of the type.
19 // ==============================================================================================================================
20 // Public member functions
21 // ==============================================================================================================================
26 * @see java.lang.Object#equals(java.lang.Object)
29 public boolean equals(final Object entity) {
30 boolean res = (entity != null);
32 if (entity instanceof String) {
33 res = this._name.equals(entity); // Names are unique
34 } else if (entity instanceof KnowledgeElementTypeDTO) {
35 KnowledgeElementTypeDTO object = (KnowledgeElementTypeDTO) entity;
36 long he = object.getIndex();
37 long me = this.getIndex();
39 res = this.getName().equals(object.getName());
50 * @see java.lang.Object#hashCode()
53 public int hashCode() {
54 long oid = getIndex(); // getIndex() is supposed fetching the index if not yet done
56 oid = super.hashCode(); // WARNING: Must not call super.toString() as it goes back here (this.toString())
58 return new StringBuffer("object ").append(getClass().getName()).append(
59 "@").append(oid).toString().hashCode();
63 * Get the name of the knowledge type.
65 * @return the type name
67 public String getName() {
76 public long getIndex() {
86 public void setIndex(final long rid) {
92 * @param name the name to set
94 public void setName(final String name) {