service layer which is used instead of the old module-layer
[mir.git] / source / mir / core / model / ArticleType.java
1 package mir.core.model;
2
3 import java.io.Serializable;
4
5 import org.apache.commons.lang.builder.EqualsBuilder;
6 import org.apache.commons.lang.builder.HashCodeBuilder;
7 import org.apache.commons.lang.builder.ToStringBuilder;
8
9 /**
10  * ArticleType
11  * @author idefix
12  * @version $Id: ArticleType.java,v 1.3 2003/08/17 16:37:29 idfx Exp $
13  */
14 public class ArticleType implements Serializable {
15
16     /** identifier field */
17     private Integer id;
18
19     /** persistent field */
20     private String name;
21
22     /** full constructor */
23     public ArticleType(java.lang.String name) {
24         this.name = name;
25     }
26
27     /** default constructor */
28     public ArticleType() {
29     }
30
31     public java.lang.Integer getId() {
32         return this.id;
33     }
34
35     public void setId(java.lang.Integer id) {
36         this.id = id;
37     }
38
39     public java.lang.String getName() {
40         return this.name;
41     }
42
43     public void setName(java.lang.String name) {
44         this.name = name;
45     }
46
47     public String toString() {
48         return new ToStringBuilder(this)
49             .append("id", getId())
50             .toString();
51     }
52
53     public boolean equals(Object other) {
54         if ( !(other instanceof ArticleType) ) return false;
55         ArticleType castOther = (ArticleType) other;
56         return new EqualsBuilder()
57             .append(this.getId(), castOther.getId())
58             .isEquals();
59     }
60
61     public int hashCode() {
62         return new HashCodeBuilder()
63             .append(getId())
64             .toHashCode();
65     }
66
67 }