alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/MessageFolderBean.java,v 1.8 2005/01/18 11:52:18 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.8 $
 * $Date: 2005/01/18 11:52:18 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2005 by MyVietnam.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * All copyright notices regarding mvnForum MUST remain intact
 * in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * http://www.mvnForum.com and http://www.MyVietnam.net in the
 * footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Support can be obtained from support forums at:
 * http://www.mvnForum.com/mvnforum/index
 *
 * Correspondence and Marketing Questions can be sent to:
 * info@MyVietnam.net
 *
 * @author: Minh Nguyen  minhnn@MyVietnam.net
 * @author: Mai  Nguyen  mai.nh@MyVietnam.net
 */
package com.mvnforum.db;

import java.sql.Timestamp;
import java.util.Collection;//for xml support
import java.util.Iterator;//for xml support

/*
 * Included columns: FolderName, MemberID, FolderOrder, FolderStatus, FolderOption,
 *                   FolderType, FolderCreationDate, FolderModifiedDate
 * Excluded columns:
 */
public class MessageFolderBean {
    private String folderName;
    private int memberID;
    private int folderOrder;
    private int folderStatus;
    private int folderOption;
    private int folderType;
    private Timestamp folderCreationDate;
    private Timestamp folderModifiedDate;

    public String getFolderName() {
        return folderName;
    }
    public void setFolderName(String folderName) {
        this.folderName = folderName;
    }

    public int getMemberID() {
        return memberID;
    }
    public void setMemberID(int memberID) {
        this.memberID = memberID;
    }

    public int getFolderOrder() {
        return folderOrder;
    }
    public void setFolderOrder(int folderOrder) {
        this.folderOrder = folderOrder;
    }

    public int getFolderStatus() {
        return folderStatus;
    }
    public void setFolderStatus(int folderStatus) {
        this.folderStatus = folderStatus;
    }

    public int getFolderOption() {
        return folderOption;
    }
    public void setFolderOption(int folderOption) {
        this.folderOption = folderOption;
    }

    public int getFolderType() {
        return folderType;
    }
    public void setFolderType(int folderType) {
        this.folderType = folderType;
    }

    public Timestamp getFolderCreationDate() {
        return folderCreationDate;
    }
    public void setFolderCreationDate(Timestamp folderCreationDate) {
        this.folderCreationDate = folderCreationDate;
    }

    public Timestamp getFolderModifiedDate() {
        return folderModifiedDate;
    }
    public void setFolderModifiedDate(Timestamp folderModifiedDate) {
        this.folderModifiedDate = folderModifiedDate;
    }

    public String getXML() {
        StringBuffer xml = new StringBuffer(1024);
        xml.append("<MessageFolderSection>\n");
        xml.append("  <Rows>\n");
        xml.append("    <Row>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>FolderName\n");
        xml.append("        <Value>").append(String.valueOf(folderName)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>MemberID\n");
        xml.append("        <Value>").append(String.valueOf(memberID)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>FolderOrder\n");
        xml.append("        <Value>").append(String.valueOf(folderOrder)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>FolderStatus\n");
        xml.append("        <Value>").append(String.valueOf(folderStatus)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>FolderOption\n");
        xml.append("        <Value>").append(String.valueOf(folderOption)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>FolderType\n");
        xml.append("        <Value>").append(String.valueOf(folderType)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>FolderCreationDate\n");
        xml.append("        <Value>").append(String.valueOf(folderCreationDate)).append("\n");
        xml.append("      </Column>\n");
        xml.append("      <Column>\n");
        xml.append("        <Name>FolderModifiedDate\n");
        xml.append("        <Value>").append(String.valueOf(folderModifiedDate)).append("\n");
        xml.append("      </Column>\n");
        xml.append("    </Row>\n");
        xml.append("  </Rows>\n");
        xml.append("</MessageFolderSection>\n");
        return xml.toString();
    }

    public static String getXML(Collection objMessageFolderBeans) {
        StringBuffer xml = new StringBuffer(1024);
        Iterator iterator = objMessageFolderBeans.iterator();
        xml.append("<MessageFolderSection>\n");
        xml.append("  <Rows>\n");
        while (iterator.hasNext()) {
            MessageFolderBean objMessageFolderBean = (MessageFolderBean)iterator.next();
            xml.append("    <Row>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>FolderName\n");
            xml.append("        <Value>").append(String.valueOf(objMessageFolderBean.folderName)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>MemberID\n");
            xml.append("        <Value>").append(String.valueOf(objMessageFolderBean.memberID)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>FolderOrder\n");
            xml.append("        <Value>").append(String.valueOf(objMessageFolderBean.folderOrder)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>FolderStatus\n");
            xml.append("        <Value>").append(String.valueOf(objMessageFolderBean.folderStatus)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>FolderOption\n");
            xml.append("        <Value>").append(String.valueOf(objMessageFolderBean.folderOption)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>FolderType\n");
            xml.append("        <Value>").append(String.valueOf(objMessageFolderBean.folderType)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>FolderCreationDate\n");
            xml.append("        <Value>").append(String.valueOf(objMessageFolderBean.folderCreationDate)).append("\n");
            xml.append("      </Column>\n");
            xml.append("      <Column>\n");
            xml.append("        <Name>FolderModifiedDate\n");
            xml.append("        <Value>").append(String.valueOf(objMessageFolderBean.folderModifiedDate)).append("\n");
            xml.append("      </Column>\n");
            xml.append("    </Row>\n");
        }//while
        xml.append("  </Rows>\n");
        xml.append("</MessageFolderSection>\n");
        return xml.toString();
    }

    /************************************************
     * Customized methods come below
     ************************************************/
    private int messageCount;
    private int unreadMessageCount;

    public int getMessageCount() {
        return messageCount;
    }

    public void setMessageCount(int messageCount) {
        this.messageCount = messageCount;
    }

    public int getUnreadMessageCount() {
        return this.unreadMessageCount;
    }

    public void setUnreadMessageCount(int unreadMessageCount) {
        this.unreadMessageCount = unreadMessageCount;
    }

} //end of class MessageFolderBean
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.