KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > syndication > feed > rss > Guid


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
21 import java.io.Serializable JavaDoc;
22
23 /**
24  * Bean for item GUIDs of RSS feeds.
25  * <p>
26  * @author Alejandro Abdelnur
27  *
28  */

29 public class Guid implements Cloneable JavaDoc,Serializable JavaDoc {
30     private ObjectBean _objBean;
31     private boolean _permaLink;
32     private String JavaDoc _value;
33
34     /**
35      * Default constructor. All properties are set to <b>null</b>.
36      * <p>
37      *
38      */

39     public Guid() {
40         _objBean = new ObjectBean(this.getClass(),this);
41     }
42
43     /**
44      * Creates a deep 'bean' clone of the object.
45      * <p>
46      * @return a clone of the object.
47      * @throws CloneNotSupportedException thrown if an element of the object cannot be cloned.
48      *
49      */

50     public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
51         return _objBean.clone();
52     }
53
54     /**
55      * Indicates whether some other object is "equal to" this one as defined by the Object equals() method.
56      * <p>
57      * @param other he reference object with which to compare.
58      * @return <b>true</b> if 'this' object is equal to the 'other' object.
59      *
60      */

61     public boolean equals(Object JavaDoc other) {
62         return _objBean.equals(other);
63     }
64
65     /**
66      * Returns a hashcode value for the object.
67      * <p>
68      * It follows the contract defined by the Object hashCode() method.
69      * <p>
70      * @return the hashcode of the bean object.
71      *
72      */

73     public int hashCode() {
74         return _objBean.hashCode();
75     }
76
77     /**
78      * Returns the String representation for the object.
79      * <p>
80      * @return String representation for the object.
81      *
82      */

83     public String JavaDoc toString() {
84         return _objBean.toString();
85     }
86
87     /**
88      * Returns the guid perma link.
89      * <p>
90      * @return the guid perma link, <b>null</b> if none.
91      *
92      */

93     public boolean isPermaLink() {
94         return _permaLink;
95     }
96
97     /**
98      * Sets the guid perma link.
99      * <p>
100      * @param permaLink the guid perma link to set, <b>null</b> if none.
101      *
102      */

103     public void setPermaLink(boolean permaLink) {
104         _permaLink = permaLink;
105     }
106
107     /**
108      * Returns the guid value.
109      * <p>
110      * @return the guid value, <b>null</b> if none.
111      *
112      */

113     public String JavaDoc getValue() {
114         return _value;
115     }
116
117     /**
118      * Sets the guid value.
119      * <p>
120      * @param value the guid value to set, <b>null</b> if none.
121      *
122      */

123     public void setValue(String JavaDoc value) {
124         _value = value;
125     }
126
127 }
128
Popular Tags