View Javadoc

1   /*
2    * Copyright 2004 Sun Microsystems, Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   */
17  package com.sun.syndication.feed.rss;
18  
19  import com.sun.syndication.feed.impl.ObjectBean;
20  import com.sun.syndication.feed.impl.ObjectBean;
21  
22  import java.io.Serializable;
23  
24  /***
25   * Bean for categories of RSS feeds.
26   * <p>
27   * @author Alejandro Abdelnur
28   *
29   */
30  public class Category implements Cloneable,Serializable {
31      private ObjectBean _objBean;
32      private String _domain;
33      private String _value;
34  
35      /***
36       * Default constructor. All properties are set to <b>null</b>.
37       * <p>
38       *
39       */
40      public Category() {
41          _objBean = new ObjectBean(this.getClass(),this);
42      }
43  
44      /***
45       * Creates a deep 'bean' clone of the object.
46       * <p>
47       * @return a clone of the object.
48       * @throws CloneNotSupportedException thrown if an element of the object cannot be cloned.
49       *
50       */
51      public Object clone() throws CloneNotSupportedException {
52          return _objBean.clone();
53      }
54  
55      /***
56       * Indicates whether some other object is "equal to" this one as defined by the Object equals() method.
57       * <p>
58       * @param other he reference object with which to compare.
59       * @return <b>true</b> if 'this' object is equal to the 'other' object.
60       *
61       */
62      public boolean equals(Object other) {
63          return _objBean.equals(other);
64      }
65  
66      /***
67       * Returns a hashcode value for the object.
68       * <p>
69       * It follows the contract defined by the Object hashCode() method.
70       * <p>
71       * @return the hashcode of the bean object.
72       *
73       */
74      public int hashCode() {
75          return _objBean.hashCode();
76      }
77  
78      /***
79       * Returns the String representation for the object.
80       * <p>
81       * @return String representation for the object.
82       *
83       */
84      public String toString() {
85          return _objBean.toString();
86      }
87  
88      /***
89       * Returns the category domain.
90       * <p>
91       * @return the category domain, <b>null</b> if none.
92       *
93       */
94      public String getDomain() {
95          return _domain;
96      }
97  
98      /***
99       * Sets the category domain.
100      * <p>
101      * @param domain the category domain to set, <b>null</b> if none.
102      *
103      */
104     public void setDomain(String domain) {
105         _domain = domain;
106     }
107 
108     /***
109      * Returns the category value.
110      * <p>
111      * @return the category value, <b>null</b> if none.
112      *
113      */
114     public String getValue() {
115         return _value;
116     }
117 
118     /***
119      * Sets the category value.
120      * <p>
121      * @param value the category value to set, <b>null</b> if none.
122      *
123      */
124     public void setValue(String value) {
125         _value = value;
126     }
127 
128 }