View Javadoc

1   /* $Id: Image.java 1102402 2011-05-12 18:03:26Z simonetripodi $
2    *
3    * Licensed to the Apache Software Foundation (ASF) under one or more
4    * contributor license agreements.  See the NOTICE file distributed with
5    * this work for additional information regarding copyright ownership.
6    * The ASF licenses this file to You under the Apache License, Version 2.0
7    * (the "License"); you may not use this file except in compliance with
8    * the License.  You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
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   * @since 2.1
25   */
26  @ObjectCreate( pattern = "rss/channel/image" )
27  public final class Image
28  {
29  
30      @BeanPropertySetter( pattern = "rss/channel/image/description" )
31      private String description;
32  
33      @BeanPropertySetter( pattern = "rss/channel/image/width" )
34      private int width;
35  
36      @BeanPropertySetter( pattern = "rss/channel/image/height" )
37      private int height;
38  
39      @BeanPropertySetter( pattern = "rss/channel/image/link" )
40      private String link;
41  
42      @BeanPropertySetter( pattern = "rss/channel/image/title" )
43      private String title;
44  
45      @BeanPropertySetter( pattern = "rss/channel/image/url" )
46      private String url;
47  
48      public String getDescription()
49      {
50          return description;
51      }
52  
53      public void setDescription( String description )
54      {
55          this.description = description;
56      }
57  
58      public int getWidth()
59      {
60          return width;
61      }
62  
63      public void setWidth( int width )
64      {
65          this.width = width;
66      }
67  
68      public int getHeight()
69      {
70          return height;
71      }
72  
73      public void setHeight( int height )
74      {
75          this.height = height;
76      }
77  
78      public String getLink()
79      {
80          return link;
81      }
82  
83      public void setLink( String link )
84      {
85          this.link = link;
86      }
87  
88      public String getTitle()
89      {
90          return title;
91      }
92  
93      public void setTitle( String title )
94      {
95          this.title = title;
96      }
97  
98      public String getUrl()
99      {
100         return url;
101     }
102 
103     public void setUrl( String url )
104     {
105         this.url = url;
106     }
107 
108     @Override
109     public boolean equals( Object obj )
110     {
111         if ( this == obj )
112             return true;
113         if ( obj == null )
114             return false;
115         if ( getClass() != obj.getClass() )
116             return false;
117         Image other = (Image) obj;
118         if ( description == null )
119         {
120             if ( other.description != null )
121                 return false;
122         }
123         else if ( !description.equals( other.description ) )
124             return false;
125         if ( height != other.height )
126             return false;
127         if ( link == null )
128         {
129             if ( other.link != null )
130                 return false;
131         }
132         else if ( !link.equals( other.link ) )
133             return false;
134         if ( title == null )
135         {
136             if ( other.title != null )
137                 return false;
138         }
139         else if ( !title.equals( other.title ) )
140             return false;
141         if ( url == null )
142         {
143             if ( other.url != null )
144                 return false;
145         }
146         else if ( !url.equals( other.url ) )
147             return false;
148         if ( width != other.width )
149             return false;
150         return true;
151     }
152 
153     @Override
154     public String toString()
155     {
156         return "Image [description=" + description + ", height=" + height + ", link=" + link + ", title=" + title
157             + ", url=" + url + ", width=" + width + "]";
158     }
159 
160 }