Last active
October 5, 2022 10:45
-
-
Save theawesomenayak/8b7e73c5a0c3dc6787cb1ec4505f84cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class NewsItem { | |
private String title; | |
private String pubDate; | |
public String getTitle() { | |
return title; | |
} | |
public void setTitle(final String title) { | |
this.title = title; | |
} | |
public String getPubDate() { | |
return pubDate; | |
} | |
public void setPubDate(final String pubDate) { | |
this.pubDate = pubDate; | |
} | |
@Override | |
public String toString() { | |
return String.format("{\"title\": \"%s\", \"date\": \"%s\"}", | |
this.title, this.pubDate); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment