You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
package Article;
|
|
|
|
import java.time.LocalDate;
|
|
|
|
public class Article {
|
|
private String title;
|
|
private String content;
|
|
private String author;
|
|
private LocalDate publishDate;
|
|
|
|
public Article(String title, String content, String author, LocalDate publishDate) {
|
|
this.title = title;
|
|
this.content = content;
|
|
this.author = author;
|
|
this.publishDate = publishDate;
|
|
}
|
|
|
|
// getters and setters
|
|
public String getTitle() { return title; }
|
|
public String getContent() { return content; }
|
|
public String getAuthor() { return author; }
|
|
public LocalDate getPublishDate() { return publishDate; }
|
|
|
|
public void setTitle(String title) { this.title = title; }
|
|
public void setContent(String content) { this.content = content; }
|
|
public void setAuthor(String author) { this.author = author; }
|
|
public void setPublishDate(LocalDate publishDate) { this.publishDate = publishDate; }
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.format("Article{title='%s', author='%s', publishDate=%s}",
|
|
title, author, publishDate);
|
|
}
|
|
}
|