1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.digester3.annotations.catalog;
19
20 import org.apache.commons.digester3.annotations.rules.ObjectCreate;
21 import org.apache.commons.digester3.annotations.rules.SetProperty;
22
23
24
25
26 @ObjectCreate.List( @ObjectCreate( pattern = "catalog/dvd" ) )
27 public final class AudioVisual
28 implements Item
29 {
30
31 @SetProperty( pattern = "catalog/dvd", attributeName = "year-made" )
32 private int yearMade;
33
34 private String category;
35
36 private String name;
37
38 private String desc;
39
40 private int runtime;
41
42 public int getYearMade()
43 {
44 return yearMade;
45 }
46
47 public void setYearMade( int yearMade )
48 {
49 this.yearMade = yearMade;
50 }
51
52 public String getCategory()
53 {
54 return this.category;
55 }
56
57 public void setCategory( String category )
58 {
59 this.category = category;
60 }
61
62 public String getName()
63 {
64 return this.name;
65 }
66
67 public void setName( String name )
68 {
69 this.name = name;
70 }
71
72 public String getDesc()
73 {
74 return this.desc;
75 }
76
77 public void setDesc( String desc )
78 {
79 this.desc = desc;
80 }
81
82 public int getRuntime()
83 {
84 return this.runtime;
85 }
86
87 public void setRuntime( int runtime )
88 {
89 this.runtime = runtime;
90 }
91
92 @Override
93 public boolean equals( Object obj )
94 {
95 if ( this == obj )
96 return true;
97 if ( obj == null )
98 return false;
99 if ( getClass() != obj.getClass() )
100 return false;
101 AudioVisual other = (AudioVisual) obj;
102 if ( this.category == null )
103 {
104 if ( other.getCategory() != null )
105 return false;
106 }
107 else if ( !this.category.equals( other.getCategory() ) )
108 return false;
109 if ( this.desc == null )
110 {
111 if ( other.getDesc() != null )
112 return false;
113 }
114 else if ( !this.desc.equals( other.getDesc() ) )
115 return false;
116 if ( this.name == null )
117 {
118 if ( other.getName() != null )
119 return false;
120 }
121 else if ( !this.name.equals( other.getName() ) )
122 return false;
123 if ( this.runtime != other.getRuntime() )
124 return false;
125 if ( this.yearMade != other.getYearMade() )
126 return false;
127 return true;
128 }
129
130 public void print()
131 {
132 System.out.println( this.toString() );
133 }
134
135 }