📄 note.java
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package com.shx.note.vo;import java.util.List;/** * * @author Administrator */public class Note { private int n_id; private String title; private String author; private String content; // 此属性用于保存全部错误信息 private List errors; //验证错误方法 public boolean invalidate() { boolean flag = true; // 验证标题是否为空 if (this.title == null || "".equals(this.title)) { flag = false; errors.add("标题不能为空!"); } // 验证作者是否为空 if (this.author == null || "".equals(this.author)) { flag = false; errors.add("作者不能为空!"); } // 验证内容是否为空 if (this.content == null || "".equals(this.content)) { flag = false; errors.add("内容不能为空!"); } return flag; } /** * @return the n_id */ public int getN_id() { return n_id; } /** * @param n_id the n_id to set */ public void setN_id(int n_id) { this.n_id = n_id; } /** * @return the title */ public String getTitle() { return title; } /** * @param title the title to set */ public void setTitle(String title) { this.title = title; } /** * @return the author */ public String getAuthor() { return author; } /** * @param author the author to set */ public void setAuthor(String author) { this.author = author; } /** * @return the content */ public String getContent() { return content; } /** * @param content the content to set */ public void setContent(String content) { this.content = content; } /** * @return the errors */ public List getErrors() { return errors; } /** * @param errors the errors to set */ public void setErrors(List errors) { this.errors = errors; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -