您当前的位置: 首页 > 

梁云亮

暂无认证

  • 1浏览

    0关注

    1211博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

基于文件的图书管理系统二:实体类+工具类

梁云亮 发布时间:2022-03-29 13:48:39 ,浏览量:1

实体类
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
public class Book {
    private String isbn;
    private String name;
    private String auth;
    private LocalDate birth;
    private String publisher;
    private BigDecimal price;
}
全局常量接口
public interface BMS {
    String DB_BOOKS = "db_books";
}

全局自定义异常类
public class GlobalException extends RuntimeException {

    public GlobalException() {
        super();
    }

    public GlobalException(String message) {
        super(message);
    }

}
随机数工具类

参考博客:随机工具类

字符串工具类
public class StringUtil {
    /**
     * 当字符串为null或长度等于0时,返回true
     *
     * @param cs
     * @return
     */
    public static boolean isEmpty(CharSequence cs) {
        return cs == null || cs.length() == 0;
    }

    /**
     * 判断字符串是否为空字符串,全部空白字符也为空。
     *
     * @param cs
     * @return
     */
    public static boolean isBlank(CharSequence cs) {
        int strLen;
        if (cs != null && (strLen = cs.length()) != 0) {
            for (int i = 0; i = min && price             
关注
打赏
1665409997
查看更多评论
0.0457s