Download After_End/MVC/src/main/java/Javabean/User.java from zxy0307/JavaWeb: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/zxy0307/JavaWeb/resolve/08aee07d7e2f3b5bea6589e92bb78197a4f61fb9/After_End/MVC/src/main/java/Javabean/User.java
- Command line
-
hf download hf://zxy0307/JavaWeb@08aee07d7e2f3b5bea6589e92bb78197a4f61fb9/After_End/MVC/src/main/java/Javabean/User.java
-
curl -L -o User.java https://huggingface.co/zxy0307/JavaWeb/resolve/08aee07d7e2f3b5bea6589e92bb78197a4f61fb9/After_End/MVC/src/main/java/Javabean/User.java
1.52 kB
| package Javabean; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Date; | |
| public class User { | |
| private String name; | |
| private int age; | |
| private Date birthday; | |
| public User() { | |
| } | |
| public User(String name, int age, Date birthday) { | |
| this.name = name; | |
| this.age = age; | |
| this.birthday = birthday; | |
| } | |
| /** | |
| * 获取 | |
| * | |
| * @return name | |
| */ | |
| public String getName() { | |
| return name; | |
| } | |
| /** | |
| * 设置 | |
| * | |
| * @param name | |
| */ | |
| public void setName(String name) { | |
| this.name = name; | |
| } | |
| /** | |
| * 获取 | |
| * | |
| * @return age | |
| */ | |
| public int getAge() { | |
| return age; | |
| } | |
| /** | |
| * 设置 | |
| * | |
| * @param age | |
| */ | |
| public void setAge(int age) { | |
| this.age = age; | |
| } | |
| /** | |
| * 获取 | |
| * | |
| * @return birthday | |
| */ | |
| public Date getBirthday() { | |
| return birthday; | |
| } | |
| /** | |
| * 设置 | |
| * | |
| * @param birthday | |
| */ | |
| public void setBirthday(Date birthday) { | |
| this.birthday = birthday; | |
| } | |
| /** | |
| * 逻辑视图 | |
| * @return | |
| */ | |
| public String getBirthStr() { | |
| //格式化日期 | |
| if (birthday != null) { | |
| SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| return sdf.format(birthday); | |
| } | |
| return null; | |
| } | |
| public String toString() { | |
| return "User{name = " + name + ", age = " + age + ", birthday = " + birthday + "}"; | |
| } | |
| } | |