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.synd;
018:
019: import com.sun.syndication.feed.impl.ObjectBean;
020: import com.sun.syndication.feed.module.DCSubjectImpl;
021: import com.sun.syndication.feed.module.DCSubject;
022:
023: import java.util.AbstractList;
024: import java.util.List;
025: import java.util.ArrayList;
026: import java.io.Serializable;
027:
028: /**
029: * Bean for authors and contributors of SyndFeedImpl feeds and entries.
030: * <p>
031: * @author Dave Johnson
032: *
033: */
034: public class SyndPersonImpl implements Serializable, SyndPerson {
035: private ObjectBean _objBean;
036: private String _name;
037: private String _uri;
038: private String _email;
039:
040: /**
041: * For implementations extending SyndContentImpl to be able to use the ObjectBean functionality
042: * with extended interfaces.
043: */
044: public SyndPersonImpl() {
045: _objBean = new ObjectBean(SyndPerson.class, this );
046: }
047:
048: /**
049: * Creates a deep 'bean' clone of the object.
050: * <p>
051: * @return a clone of the object.
052: * @throws CloneNotSupportedException thrown if an element of the object cannot be cloned.
053: *
054: */
055: public Object clone() throws CloneNotSupportedException {
056: return _objBean.clone();
057: }
058:
059: /**
060: * Indicates whether some other object is "equal to" this one as defined by the Object equals() method.
061: * <p>
062: * @param other he reference object with which to compare.
063: * @return <b>true</b> if 'this' object is equal to the 'other' object.
064: *
065: */
066: public boolean equals(Object other) {
067: return _objBean.equals(other);
068: }
069:
070: /**
071: * Returns a hashcode value for the object.
072: * <p>
073: * It follows the contract defined by the Object hashCode() method.
074: * <p>
075: * @return the hashcode of the bean object.
076: *
077: */
078: public int hashCode() {
079: return _objBean.hashCode();
080: }
081:
082: /**
083: * Returns the String representation for the object.
084: * <p>
085: * @return String representation for the object.
086: *
087: */
088: public String toString() {
089: return _objBean.toString();
090: }
091:
092: /**
093: * Returns the person name.
094: * <p>
095: * @return the person name, <b>null</b> if none.
096: *
097: */
098: public String getName() {
099: return _name;
100: }
101:
102: /**
103: * Sets the category name.
104: * <p>
105: * @param name the category name to set, <b>null</b> if none.
106: *
107: */
108: public void setName(String name) {
109: _name = name;
110: }
111:
112: /**
113: * Returns the person's e-mail address.
114: * <p>
115: * @return the person's e-mail address, <b>null</b> if none.
116: *
117: */
118: public String getEmail() {
119: return _email;
120: }
121:
122: /**
123: * Sets the person's e-mail address.
124: * <p>
125: * @param email The person's e-mail address to set, <b>null</b> if none.
126: *
127: */
128: public void setEmail(String email) {
129: _email = email;
130: }
131:
132: /**
133: * Returns the person's URI.
134: * <p>
135: * @return the person's URI, <b>null</b> if none.
136: *
137: */
138: public String getUri() {
139: return _uri;
140: }
141:
142: /**
143: * Sets the person's URI.
144: * <p>
145: * @param uri the peron's URI to set, <b>null</b> if none.
146: *
147: */
148: public void setUri(String uri) {
149: _uri = uri;
150: }
151: }
|