    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.api.core.Page;
    022
    023
    024/**
    025 * Represents an entry, that is, an unit of change, in a Feed.
    026 */
    027public class Entry {
    028
    029    private String m_content;
    030    private String m_url;
    031    private String m_title;
    032    private Page m_page;
    033    private String m_author;
    034
    035    /**
    036     * Set the author of this entry.
    037     *
    038     * @param author Name of the author.
    039     */
    040    public void setAuthor( final String author ) {
    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        return m_author;
    051    }
    052
    053    /**
    054     * Returns the page set by {@link #setPage(Page)}.
    055     *
    056     * @return The WikiPage to which this Entry refers to.
    057     */
    058    public Page getPage() {
    059        return m_page;
    060    }
    061
    062    /**
    063     * Sets the WikiPage to which this Entry refers to.
    064     *
    065     * @param p A valid WikiPage.
    066     */
    067    public void setPage( final Page p ) {
    068        m_page = p;
    069    }
    070
    071    /**
    072     * Sets a title for the change.  For example, a WebLog entry might use the
    073     * post title, or a Wiki change could use something like "XXX changed page YYY".
    074     *
    075     * @param title A String description of the change.
    076     */
    077    public void setTitle( final String title ) {
    078        m_title = title;
    079    }
    080
    081    /**
    082     * Returns the title.
    083     *
    084     * @return The title set in setTitle.
    085     */
    086    public String getTitle() {
    087        return m_title;
    088    }
    089
    090    /**
    091     * Set the URL - the permalink - of the Entry.
    092     *
    093     * @param url An absolute URL to the entry.
    094     */
    095    public void setURL( final String url ) {
    096        m_url = url;
    097    }
    098
    099    /**
    100     * Return the URL set by setURL().
    101     *
    102     * @return The URL.
    103     */
    104    public String getURL() {
    105        return m_url;
    106    }
    107
    108    /**
    109     * Set the content of this entry.
    110     *
    111     * @param content A String of the content.
    112     */
    113    public void setContent( final String content ) {
    114        m_content = content;
    115    }
    116
    117    /**
    118     * Return the content set by {@link #setContent(String)}.
    119     *
    120     * @return Whatever was set by setContent().
    121     */
    122    public String getContent() {
    123        return m_content;
    124    }
    125
    126}