Kawai Wiki

Rev

Rev 136 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.kawai.model;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * Model class Revision.
 *
 * @author Sergio Oliveira
 *
 */

public class Revision {

        /**Attribute constant FORMATTER of Revision. */
    private static final SimpleDateFormat FORMATTER = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");

    /** Attribute id of Revision. */
    private int id;
    /** Attribute revision of Revision. */
    private Integer revision;
    /** Attribute name of Revision. */
    private String name;
    /** Attribute languageId of Revision. */
    private int languageId;
    /** Attribute userId of Revision. */
    private int userId;
    /** Attribute user of Revision. */
    private User user;
    /** Attribute currTitle of Revision. */
    private String currTitle;
    /** Attribute oldTitle of Revision. */
    private String oldTitle;
    /** Attribute newTitle of Revision. */
    private String newTitle;
    /** Attribute oldBody of Revision. */
    private String oldBody;
    /** Attribute newBody of Revision. */
    private String newBody;
    /** Attribute createdOn of Revision. */
    private Date createdOn;
    /** Attribute comment of Revision. */
    private String comment;
    /** Attribute isSystemPage of Revision. */
    private boolean isSystemPage;
    /** Attribute isFrontPage of Revision. */
    private boolean isFrontPage;

    /**
     * Default constructor.
     */

    public Revision() { }

    /**
     * Gets the id of Revision.
     * @return int
     */

    public int getId() {
        return id;
    }

    /**
     * Sets the id of Revision.
     * @param s String
     */

    public void setTitle(String s) {
        this.currTitle = s;
    }

    /**
     * Gets the currTitle of Revision.
     * @return String
     */

    public String getTitle() {
        return currTitle;
    }

    /**
     * Sets if isFrontPage of Revision.
     * @param b boolean
     */

    public void setFrontPage(boolean b) {
        this.isFrontPage = b;
    }

    /**
     * Check if isFrontPage of Revision.
     * @return boolean
     */

    public boolean isFrontPage() {
        return isFrontPage;
    }

    /**
     * Set if isSystemPage of Revision.
     * @param b boolean
     */

    public void setSystemPage(boolean b) {
        this.isSystemPage = b;
    }

    /**
     * Checks if isSystemPage of Revision.
     * @return boolean
     */

    public boolean isSystemPage() {
        return isSystemPage;
    }

    /**
     * Gets the comment of Revision.
     * @return String
     */

    public String getComment() {
        return comment;
    }

    /**
     * Sets the comment of Revision.
     * @param s String
     */

    public void setComment(String s) {
        this.comment = s;
    }

    /**
     * Sets the id of Revision.
     * @param id int
     */

    public void setId(int id) {
        this.id = id;
    }

    /**
     * Gets the revision of Revision.
     * @return Integer
     */

    public Integer getRevision() {
        return revision;
    }

    /**
     * Sets the revision of Revision.
     * @param revision int
     */

    public void setRevision(int revision) {
        this.revision = revision;
    }

    /**
     * Gets the name of Revision.
     * @return String
     */

    public String getName() {
        return name;
    }

    /**
     * Sets the name of Revision.
     * @param name String
     */

    public void setName(String name) {
        this.name = name;
    }

    /**
     * Gets the languageId of Revision.
     * @return int
     */

    public int getLanguageId() {
        return languageId;
    }

    /**
     * Sets the languageId of Revision.
     * @param languageId int
     */

    public void setLanguageId(int languageId) {
        this.languageId = languageId;
    }

    /**
     * Gets the userId of Revision.
     * @return int
     */

    public int getUserId() {
        return userId;
    }

    /**
     * Sets the userId of Revision.
     * @param userId int
     */

    public void setUserId(int userId) {
        this.userId = userId;
    }

    /**
     * Gets the user of Revision.
     * @return user
     */

    public User getUser() {
        return user;
    }

    /**
     * Sets the user of Revision.
     * @param user User
     */

    public void setUser(User user) {
        this.user = user;
    }

    /**
     * Gets the oldTitle of Revision.
     * @return String
     */

    public String getOldTitle() {
        return oldTitle;
    }

    /**
     * Sets the oldTitle of Revision.
     * @param oldTitle String
     */

    public void setOldTitle(String oldTitle) {
        this.oldTitle = oldTitle;
    }

    /**
     * Gets the newTitle of Revision.
     * @return String
     */

    public String getNewTitle() {
        return newTitle;
    }

    /**
     * Sets the newTitle of Revision.
     * @param newTitle String
     */

    public void setNewTitle(String newTitle) {
        this.newTitle = newTitle;
    }

    /**
     * Gets the language of Revision.
     * @return Language
     */

    public Language getLanguage() {
        return Language.fromId(languageId);
    }

    /**
     * Gets the locale of Revision.
     * @return Locale
     */

    public Locale getLocale() {
        return getLanguage() != null ? getLanguage().getLocale() : null;
    }

    /**
     * Gets the lang of Revision.
     * @return String
     */

    public String getLang() {
        return getLocale() != null ? getLocale().toString() : null;
    }

    /**
     * Gets the oldBody of Revision.
     * @return String
     */

    public String getOldBody() {
        return oldBody;
    }

    /**
     * Sets the oldBody of Revision.
     * @param oldBody String
     */

    public void setOldBody(String oldBody) {
        this.oldBody = oldBody;
    }

    /**
     * Gets the newBody of Revision.
     * @return String
     */

    public String getNewBody() {
        return newBody;
    }

    /**
     * Sets the newBody of Revision.
     * @param newBody String
     */

    public void setNewBody(String newBody) {
        this.newBody = newBody;
    }

    /**
     * Gets the createdOn date of Revision.
     * @return Date
     */

    public Date getCreatedOn() {
        return createdOn;
    }

    /**
     * Gets the formatted createdOn date of Revision.
     * @return String
     */

    public String getFormattedCreatedOn() {
        return FORMATTER.format(createdOn);
    }

    /**
     * Sets the createdOn date of Revision.
     * @param createdOn Date
     */

    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }

}