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.atom;
18  
19  import com.sun.syndication.feed.impl.ObjectBean;
20  
21  import java.io.Serializable;
22  
23  /***
24   * Bean for person elements of Atom feeds.
25   * <p>
26   * @author Alejandro Abdelnur
27   *
28   */
29  public class Person implements Cloneable,Serializable  {
30      private ObjectBean _objBean;
31      private String _name;
32      private String _url;
33      private String _email;
34  
35      /***
36       * Default constructor. All properties are set to <b>null</b>.
37       * <p>
38       *
39       */
40      public Person() {
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 person name.
90        * <p>
91        * @return the person name, <b>null</b> if none.
92        *
93        */
94      public String getName() {
95          return _name;
96      }
97  
98      /***
99        * Sets the personname.
100       * <p>
101       * @param name the person name, <b>null</b> if none.
102       *
103       */
104     public void setName(String name) {
105         _name = name;
106     }
107 
108     /***
109       * Returns the person URL.
110       * <p>
111       * @return the person URL, <b>null</b> if none.
112       *
113       */
114     public String getUrl() {
115         return _url;
116     }
117 
118     /***
119       * Sets the person URL.
120       * <p>
121       * @param url the person URL, <b>null</b> if none.
122       *
123       */
124     public void setUrl(String url) {
125         _url = url;
126     }
127 
128     /***
129       * Returns the person email.
130       * <p>
131       * @return the person email, <b>null</b> if none.
132       *
133       */
134     public String getEmail() {
135         return _email;
136     }
137 
138     /***
139       * Sets the person email.
140       * <p>
141       * @param email the person email, <b>null</b> if none.
142       *
143       */
144     public void setEmail(String email) {
145         _email = email;
146     }
147 
148 }