Skip to content

Instantly share code, notes, and snippets.

Created August 27, 2015 10:21
What would you like to do?
public class Post {
public Long id;
public String by;
public Long time;
public ArrayList<Long> kids;
public String url;
public Long score;
public String title;
public String text;
public PostType postType;
public enum PostType {
private String string;
PostType(String string) {
this.string = string;
public static PostType fromString(String string) {
if (string != null) {
for (PostType postType : PostType.values()) {
if (string.equalsIgnoreCase(postType.string)) return postType;
return null;
public Post() { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment