⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commentinfo.java

📁 辅助办公系统,具有发布公告、站内邮箱、日程安排、日志查看等功能
💻 JAVA
字号:
package com.x3408.download;

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

public class CommentInfo {
	private int commentID;
	private int fileID;
	private String comment;
	private String commenter;
	private String commentPubTime;
	
	public CommentInfo(){
		
	}
	public CommentInfo(String pCommentID,String pFileID,String pComment,String pCommenter,String pCommentPubTime){
		this.setCommentID(pCommentID);
		this.setFileID(pFileID);
		this.setComment(pComment);
		this.setCommenter(pCommenter);
		this.setCommentPubTime(pCommentPubTime);
	}
	
	public CommentInfo(String pFileID,String pComment,String pCommenter){
		this.setFileID(pFileID);
		this.setComment(pComment);
		this.setCommenter(pCommenter);
		this.setCommentPubTime();
	}
	
	public boolean isValid(){
		if(this.fileID==0||this.comment==null||this.comment.equals("")){
			return false;
		}
		return true;
	}
	public int getCommentID(){
		return this.commentID;
	}
	public int getFileID(){
		return this.fileID;
	}
	public String getComment(){
		return this.comment;
	}
	public String getCommenter(){
		return this.commenter;
	}
	public String getCommentPubTime(){
		return this.commentPubTime;
	}
	public void setFileID(String pFileID){
		try{
			this.fileID=Integer.parseInt(pFileID);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	public void setCommentID(String pCommentID){
		if (pCommentID!=null){
			try{
				this.commentID=Integer.parseInt(pCommentID);
			}catch(Exception e){
				e.printStackTrace();
			}
		}
	}
	public void setComment(String pComment){
		this.comment=pComment;
		if(this.comment.length()>400){
			this.comment=this.comment.substring(0, 399);
		}
	}
	public void setCommenter(String pCommenter){
		this.commenter=pCommenter;
	}
	public void setCommentPubTime(){
		this.commentPubTime=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
	}
	public void setCommentPubTime(String pCommentPubTime){
		this.commentPubTime=pCommentPubTime;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -