001: /**
002: * Copyright (c) 2003-2007, David A. Czarnecki
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions are met:
007: *
008: * Redistributions of source code must retain the above copyright notice, this list of conditions and the
009: * following disclaimer.
010: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
011: * following disclaimer in the documentation and/or other materials provided with the distribution.
012: * Neither the name of "David A. Czarnecki" and "blojsom" nor the names of its contributors may be used to
013: * endorse or promote products derived from this software without specific prior written permission.
014: * Products derived from this software may not be called "blojsom", nor may "blojsom" appear in their name,
015: * without prior written permission of David A. Czarnecki.
016: *
017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
018: * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
019: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
020: * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
021: * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
022: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
025: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
026: * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
027: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
028: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
029: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
030: */package org.blojsom.plugin.syndication.module;
031:
032: import java.util.ArrayList;
033: import java.util.Date;
034: import java.util.List;
035:
036: /**
037: * Simple comment
038: *
039: * @author David Czarnecki
040: * @version $Id: SimpleComment.java,v 1.3 2007/01/17 02:35:06 czarneckid Exp $
041: * @since blojsom 3.0
042: */
043: public class SimpleComment implements Cloneable {
044:
045: private String author;
046: private String authorURL;
047: private String authorEmail;
048: private String comment;
049: private Date commentDate;
050: private String ip;
051: private String status;
052: private List metadata;
053:
054: public SimpleComment() {
055: }
056:
057: public String getAuthor() {
058: return author;
059: }
060:
061: public void setAuthor(String author) {
062: this .author = author;
063: }
064:
065: public String getAuthorURL() {
066: return authorURL;
067: }
068:
069: public void setAuthorURL(String authorURL) {
070: this .authorURL = authorURL;
071: }
072:
073: public String getAuthorEmail() {
074: return authorEmail;
075: }
076:
077: public void setAuthorEmail(String authorEmail) {
078: this .authorEmail = authorEmail;
079: }
080:
081: public String getComment() {
082: return comment;
083: }
084:
085: public void setComment(String comment) {
086: this .comment = comment;
087: }
088:
089: public Date getCommentDate() {
090: return commentDate;
091: }
092:
093: public void setCommentDate(Date commentDate) {
094: this .commentDate = commentDate;
095: }
096:
097: public String getIp() {
098: return ip;
099: }
100:
101: public void setIp(String ip) {
102: this .ip = ip;
103: }
104:
105: public String getStatus() {
106: return status;
107: }
108:
109: public void setStatus(String status) {
110: this .status = status;
111: }
112:
113: public List getMetadata() {
114: return metadata;
115: }
116:
117: public void setMetadata(List metadata) {
118: this .metadata = metadata;
119: }
120:
121: public Object clone() throws CloneNotSupportedException {
122: SimpleComment cloned = new SimpleComment();
123:
124: cloned.setAuthor(author);
125: cloned.setAuthorEmail(authorEmail);
126: cloned.setAuthorURL(authorURL);
127: cloned.setComment(comment);
128: cloned.setCommentDate(commentDate);
129: cloned.setIp(ip);
130: cloned.setStatus(status);
131:
132: // Process metadata
133: List copiedMetadata = new ArrayList();
134: if (metadata != null) {
135: for (int i = 0; i < metadata.size(); i++) {
136: Metadata metadataItem = (Metadata) metadata.get(i);
137: Metadata copiedMetadataItem = new Metadata();
138: copiedMetadataItem.setKey(metadataItem.getKey());
139: copiedMetadataItem.setValue(metadataItem.getValue());
140:
141: copiedMetadata.add(copiedMetadataItem);
142: }
143: }
144: cloned.setMetadata(copiedMetadata);
145:
146: return cloned;
147: }
148: }
|