001: /*
002: * Copyright 2004 Sun Microsystems, Inc.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: *
016: */
017: package com.sun.syndication.feed.atom;
018:
019: import com.sun.syndication.feed.impl.ObjectBean;
020:
021: import java.io.Serializable;
022:
023: /**
024: * Bean for category elements of Atom feeds.
025: * <p>
026: * @author Dave Johnson (added for Atom 1.0)
027: */
028: public class Category implements Cloneable, Serializable {
029:
030: private ObjectBean _objBean;
031:
032: private String _term;
033: private String _scheme;
034: private String _label;
035:
036: /**
037: * Default constructor. All properties are set to <b>null</b>.
038: * <p>
039: *
040: */
041: public Category() {
042: _objBean = new ObjectBean(this .getClass(), this );
043: }
044:
045: /**
046: * Creates a deep 'bean' clone of the object.
047: * <p>
048: * @return a clone of the object.
049: * @throws CloneNotSupportedException thrown if an element of the object cannot be cloned.
050: *
051: */
052: public Object clone() throws CloneNotSupportedException {
053: return _objBean.clone();
054: }
055:
056: /**
057: * Indicates whether some other object is "equal to" this one as defined by the Object equals() method.
058: * <p>
059: * @param other he reference object with which to compare.
060: * @return <b>true</b> if 'this' object is equal to the 'other' object.
061: *
062: */
063: public boolean equals(Object other) {
064: return _objBean.equals(other);
065: }
066:
067: /**
068: * Returns a hashcode value for the object.
069: * <p>
070: * It follows the contract defined by the Object hashCode() method.
071: * <p>
072: * @return the hashcode of the bean object.
073: *
074: */
075: public int hashCode() {
076: return _objBean.hashCode();
077: }
078:
079: /**
080: * Returns the String representation for the object.
081: * <p>
082: * @return String representation for the object.
083: *
084: */
085: public String toString() {
086: return _objBean.toString();
087: }
088:
089: /**
090: * Get label for category.
091: * <p>
092: * @return Label for category.
093: */
094: public String getLabel() {
095: return _label;
096: }
097:
098: /**
099: * Set label for category.
100: * <p>
101: * @param Label for category.
102: */
103: public void setLabel(String label) {
104: this ._label = label;
105: }
106:
107: /**
108: * Get Scheme URI for category.
109: * <p>
110: * @return Scheme URI for category.
111: */
112: public String getScheme() {
113: return _scheme;
114: }
115:
116: /**
117: * Set scheme URI for category.
118: * <p>
119: * @param Scheme URI for category.
120: */
121: public void setScheme(String scheme) {
122: this ._scheme = scheme;
123: }
124:
125: /**
126: * Return term for category.
127: * <p>
128: * @return Term for category.
129: */
130: public String getTerm() {
131: return _term;
132: }
133:
134: /**
135: * Set term for category.
136: * <p>
137: * @param Term for category.
138: */
139: public void setTerm(String term) {
140: this._term = term;
141: }
142: }
|