001/* 
002    Licensed to the Apache Software Foundation (ASF) under one
003    or more contributor license agreements.  See the NOTICE file
004    distributed with this work for additional information
005    regarding copyright ownership.  The ASF licenses this file
006    to you under the Apache License, Version 2.0 (the
007    "License"); you may not use this file except in compliance
008    with the License.  You may obtain a copy of the License at
009
010       http://www.apache.org/licenses/LICENSE-2.0
011
012    Unless required by applicable law or agreed to in writing,
013    software distributed under the License is distributed on an
014    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015    KIND, either express or implied.  See the License for the
016    specific language governing permissions and limitations
017    under the License.  
018 */
019package org.apache.wiki.rss;
020
021import org.apache.wiki.WikiPage;
022
023/**
024 *  Represents an entry, that is, an unit of change, in a Feed.
025 */
026public class Entry
027{
028    private String   m_content;
029    private String   m_url;
030    private String   m_title;
031    private WikiPage m_page;
032    private String   m_author;
033
034    /**
035     *  Set the author of this entry.
036     *  
037     *  @param author Name of the author.
038     */
039    public void setAuthor( String author )
040    {
041        m_author = author;
042    }
043
044    /**
045     *  Return the author set by setAuthor().
046     *  
047     *  @return A String representing the author.
048     */
049    public String getAuthor()
050    {
051        return m_author;
052    }
053
054    /**
055     *  Returns the page set by {@link #setPage(WikiPage)}.
056     *  
057     *  @return The WikiPage to which this Entry refers to.
058     */
059    public WikiPage getPage()
060    {
061        return m_page;
062    }
063
064    /**
065     *  Sets the WikiPage to which this Entry refers to.
066     *  
067     *  @param p A valid WikiPage.
068     */
069    public void setPage( WikiPage p )
070    {
071        m_page = p;
072    }
073
074    /**
075     *  Sets a title for the change.  For example, a WebLog entry might use the
076     *  post title, or a Wiki change could use something like "XXX changed page YYY".
077     *  
078     *  @param title A String description of the change.
079     */
080    public void setTitle( String title )
081    {
082        m_title = title;
083    }
084
085    /**
086     *  Returns the title.
087     *  
088     *  @return The title set in setTitle.
089     */
090    public String getTitle()
091    {
092        return m_title;
093    }
094
095    /**
096     *  Set the URL - the permalink - of the Entry.
097     *  
098     *  @param url An absolute URL to the entry.
099     */
100    public void setURL( String url )
101    {
102        m_url = url;
103    }
104
105    /**
106     *  Return the URL set by setURL().
107     *  
108     *  @return The URL.
109     */
110    public String getURL()
111    {
112        return m_url;
113    }
114
115    /**
116     *  Set the content of this entry.
117     *  
118     *  @param content A String of the content.
119     */
120    public void setContent( String content )
121    {
122        m_content = content;
123    }
124
125    /**
126     *  Return the content set by {@link #setContent(String)}.
127     *  
128     *  @return Whatever was set by setContent().
129     */
130    public String getContent()
131    {
132        return m_content;
133    }
134}