1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.digester3.annotations.rss;
19
20 import org.apache.commons.digester3.annotations.rules.BeanPropertySetter;
21 import org.apache.commons.digester3.annotations.rules.ObjectCreate;
22
23
24
25
26 @ObjectCreate( pattern = "rss/channel/item" )
27 public final class Item
28 {
29
30 @BeanPropertySetter( pattern = "rss/channel/item/description" )
31 private String description;
32
33 @BeanPropertySetter( pattern = "rss/channel/item/link" )
34 private String link;
35
36 @BeanPropertySetter( pattern = "rss/channel/item/title" )
37 private String title;
38
39 public String getDescription()
40 {
41 return description;
42 }
43
44 public void setDescription( String description )
45 {
46 this.description = description;
47 }
48
49 public String getLink()
50 {
51 return link;
52 }
53
54 public void setLink( String link )
55 {
56 this.link = link;
57 }
58
59 public String getTitle()
60 {
61 return title;
62 }
63
64 public void setTitle( String title )
65 {
66 this.title = title;
67 }
68
69 @Override
70 public boolean equals( Object obj )
71 {
72 if ( this == obj )
73 return true;
74 if ( obj == null )
75 return false;
76 if ( getClass() != obj.getClass() )
77 return false;
78 Item other = (Item) obj;
79 if ( description == null )
80 {
81 if ( other.description != null )
82 return false;
83 }
84 else if ( !description.equals( other.description ) )
85 return false;
86 if ( link == null )
87 {
88 if ( other.link != null )
89 return false;
90 }
91 else if ( !link.equals( other.link ) )
92 return false;
93 if ( title == null )
94 {
95 if ( other.title != null )
96 return false;
97 }
98 else if ( !title.equals( other.title ) )
99 return false;
100 return true;
101 }
102
103 @Override
104 public String toString()
105 {
106 return "Item [description=" + description + ", link=" + link + ", title=" + title + "]";
107 }
108
109 }