001/* $Id: Image.java 1102402 2011-05-12 18:03:26Z simonetripodi $ 002 * 003 * Licensed to the Apache Software Foundation (ASF) under one or more 004 * contributor license agreements. See the NOTICE file distributed with 005 * this work for additional information regarding copyright ownership. 006 * The ASF licenses this file to You under the Apache License, Version 2.0 007 * (the "License"); you may not use this file except in compliance with 008 * the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018package org.apache.commons.digester3.annotations.rss; 019 020import org.apache.commons.digester3.annotations.rules.BeanPropertySetter; 021import org.apache.commons.digester3.annotations.rules.ObjectCreate; 022 023/** 024 * @since 2.1 025 */ 026@ObjectCreate( pattern = "rss/channel/image" ) 027public final class Image 028{ 029 030 @BeanPropertySetter( pattern = "rss/channel/image/description" ) 031 private String description; 032 033 @BeanPropertySetter( pattern = "rss/channel/image/width" ) 034 private int width; 035 036 @BeanPropertySetter( pattern = "rss/channel/image/height" ) 037 private int height; 038 039 @BeanPropertySetter( pattern = "rss/channel/image/link" ) 040 private String link; 041 042 @BeanPropertySetter( pattern = "rss/channel/image/title" ) 043 private String title; 044 045 @BeanPropertySetter( pattern = "rss/channel/image/url" ) 046 private String url; 047 048 public String getDescription() 049 { 050 return description; 051 } 052 053 public void setDescription( String description ) 054 { 055 this.description = description; 056 } 057 058 public int getWidth() 059 { 060 return width; 061 } 062 063 public void setWidth( int width ) 064 { 065 this.width = width; 066 } 067 068 public int getHeight() 069 { 070 return height; 071 } 072 073 public void setHeight( int height ) 074 { 075 this.height = height; 076 } 077 078 public String getLink() 079 { 080 return link; 081 } 082 083 public void setLink( String link ) 084 { 085 this.link = link; 086 } 087 088 public String getTitle() 089 { 090 return title; 091 } 092 093 public void setTitle( String title ) 094 { 095 this.title = title; 096 } 097 098 public String getUrl() 099 { 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}