Kawai Wiki

Rev

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

package org.kawai.model;

import java.util.Date;

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

public class Preview {

    /** Attribute id of Preview. */
    private int id;
    /** Attribute userId of Preview. */
    private int userId;
    /** Attribute user of Preview. */
    private User user;
    /** Attribute name of Preview. */
    private String name;
    /** Attribute languageId of Preview. */
    private int languageId;
    /** Attribute title of Preview. */
    private String title;
    /** Attribute body of Preview. */
    private String body;
    /** Attribute createdOn of Preview. */
    private Date createdOn;
    /** Attribute isNew of Preview. */
    private boolean isNew;
    /** Attribute isSystemPage of Preview. */
    private boolean isSystemPage;
    /** Attribute comment of Preview. */
    private String comment;

    /**
     * Default constructor.
     */

    public Preview() { }

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

    public int getId() {
        return id;
    }

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

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

    /**
     * Sets the comment of Preview.
     * @param comment String
     */

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

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

    public String getComment() {
        return comment;
    }

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

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

    /**
     * Gets the user of Preview.
     * @return User
     */

    public User getUser() {
        return user;
    }

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

    public int getUserId() {
        return userId;
    }

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

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

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

    public Date getCreatedOn() {
        return createdOn;
    }

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

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

    /**
     * Gets the title of Preview.
     * @return String
     */

    public String getTitle() {
        return title;
    }

    /**
     * Sets the title of Preview.
     * @param title String
     */

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

    /**
     * Gets the body of Preview.
     * @return String
     */

    public String getBody() {
        return body;
    }

    /**
     * Sets the body of Preview.
     * @param body String
     */

    public void setBody(String body) {
        this.body = body;
    }

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

    public String getName() {
        return name;
    }

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

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

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

    public int getLanguageId() {
        return languageId;
    }

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

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

    /**
     * Sets the new attribute of Preview.
     * @param b boolean
     */

    public void setNew(boolean b) {
        this.isNew = b;
    }

    /**
     * Return if isNew Preview.
     * @return boolean
     */

    public boolean isNew() {
        return isNew;
    }

    /**
     * Sets if isSystemPage of Preview.
     * @param b boolean
     */

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

    /**
     * Returns true if isSystemPage.
     * @return boolean
     */

    public boolean isSystemPage() {
        return isSystemPage;
    }

    /**
     * Gets the populated page object of Preview.
     * @return Page
     */

    public Page getPage() {
        Page p = new Page();
        p.setId(-1);
        p.setName(name);
        p.setLanguageId(languageId);
        p.setTitle(title);
        p.setBody(body);
        p.setDeleted(false);
        p.setCreatedById(userId);
        p.setCreatedBy(user);
        p.setCreatedOn(createdOn);
        p.setPreview(true);
        p.setNew(isNew);
        p.setSystemPage(isSystemPage);
        p.setComment(comment);

        return p;
    }
}