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: import com.sun.syndication.feed.impl.ObjectBean;
021:
022: import java.io.Serializable;
023:
024: /**
025: * Bean for the generator element of Atom feeds.
026: * <p>
027: * @author Alejandro Abdelnur
028: *
029: */
030: public class Generator implements Cloneable, Serializable {
031: private ObjectBean _objBean;
032: private String _url;
033: private String _version;
034: private String _value;
035:
036: /**
037: * Default constructor. All properties are set to <b>null</b>.
038: * <p>
039: *
040: */
041: public Generator() {
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: * Returns the generator URL.
091: * <p>
092: * @return the generator URL, <b>null</b> if none.
093: *
094: */
095: public String getUrl() {
096: return _url;
097: }
098:
099: /**
100: * Sets the generator URL.
101: * <p>
102: * @param url the generator URL, <b>null</b> if none.
103: *
104: */
105: public void setUrl(String url) {
106: _url = url;
107: }
108:
109: /**
110: * Returns the generator version.
111: * <p>
112: * @return the generator version, <b>null</b> if none.
113: *
114: */
115: public String getVersion() {
116: return _version;
117: }
118:
119: /**
120: * Sets the generator version.
121: * <p>
122: * @param version the generator version, <b>null</b> if none.
123: *
124: */
125: public void setVersion(String version) {
126: _version = version;
127: }
128:
129: /**
130: * Returns the generator value.
131: * <p>
132: * @return the generator value, <b>null</b> if none.
133: *
134: */
135: public String getValue() {
136: return _value;
137: }
138:
139: /**
140: * Sets the generator value.
141: * <p>
142: * @param value the generator value, <b>null</b> if none.
143: *
144: */
145: public void setValue(String value) {
146: _value = value;
147: }
148:
149: }
|