1 changed files with 31 additions and 0 deletions
@ -0,0 +1,31 @@ |
|||
import java.time.LocalDate; |
|||
|
|||
public class Article { |
|||
private String title; |
|||
private String content; |
|||
private String url; |
|||
private String author; |
|||
private LocalDate publishDate; |
|||
|
|||
public Article(String title, String content, String url, String author, LocalDate publishDate) { |
|||
this.title = title; |
|||
this.content = content; |
|||
this.url = url; |
|||
this.author = author; |
|||
this.publishDate = publishDate; |
|||
} |
|||
|
|||
public String getAuthor() { return author; } |
|||
public void setAuthor(String author) { this.author = author; } |
|||
|
|||
public LocalDate getPublishDate() { return publishDate; } |
|||
public void setPublishDate(LocalDate publishDate) { this.publishDate = publishDate; } |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "标题:" + title + |
|||
" | 作者:" + author + |
|||
" | 发布日期:" + publishDate + |
|||
" | 链接:" + url; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue