-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
242 additions
and
194 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/com/github/yvasyliev/model/dto/PostType.java
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
src/main/java/com/github/yvasyliev/model/dto/post/GifPost.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.github.yvasyliev.model.dto.post; | ||
|
||
public class GifPost extends MediaPost { | ||
@Override | ||
public String getType() { | ||
return Type.GIF; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/github/yvasyliev/model/dto/post/MediaPost.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.github.yvasyliev.model.dto.post; | ||
|
||
public abstract class MediaPost extends SpoilerablePost { | ||
private String mediaUrl; | ||
|
||
public String getMediaUrl() { | ||
return mediaUrl; | ||
} | ||
|
||
public void setMediaUrl(String mediaUrl) { | ||
this.mediaUrl = mediaUrl; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/github/yvasyliev/model/dto/post/PhotoGroupPost.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.github.yvasyliev.model.dto.post; | ||
|
||
import java.util.List; | ||
|
||
public class PhotoGroupPost extends SpoilerablePost { | ||
private List<List<String>> photoUrlsPages; | ||
|
||
public List<List<String>> getPhotoUrlsPages() { | ||
return photoUrlsPages; | ||
} | ||
|
||
public void setPhotoUrlsPages(List<List<String>> photoUrlsPages) { | ||
this.photoUrlsPages = photoUrlsPages; | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
return Type.PHOTO_GROUP; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/github/yvasyliev/model/dto/post/PhotoPost.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.github.yvasyliev.model.dto.post; | ||
|
||
public class PhotoPost extends MediaPost { | ||
@Override | ||
public String getType() { | ||
return Type.PHOTO; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/github/yvasyliev/model/dto/post/PollPost.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.github.yvasyliev.model.dto.post; | ||
|
||
import java.util.List; | ||
|
||
public class PollPost extends Post { | ||
private List<String> options; | ||
|
||
public List<String> getOptions() { | ||
return options; | ||
} | ||
|
||
public void setOptions(List<String> options) { | ||
this.options = options; | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
return Type.POLL; | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
src/main/java/com/github/yvasyliev/model/dto/post/Post.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.github.yvasyliev.model.dto.post; | ||
|
||
public abstract class Post implements Comparable<Post> { | ||
private int created; | ||
private String author; | ||
private boolean approved; | ||
private String postUrl; | ||
private String text; | ||
|
||
public String getText() { | ||
return text; | ||
} | ||
|
||
public void setText(String text) { | ||
this.text = text; | ||
} | ||
|
||
public abstract String getType(); | ||
|
||
public int getCreated() { | ||
return created; | ||
} | ||
|
||
public void setCreated(int created) { | ||
this.created = created; | ||
} | ||
|
||
public String getAuthor() { | ||
return author; | ||
} | ||
|
||
public void setAuthor(String author) { | ||
this.author = author; | ||
} | ||
|
||
public boolean isApproved() { | ||
return approved; | ||
} | ||
|
||
public void setApproved(boolean approved) { | ||
this.approved = approved; | ||
} | ||
|
||
public String getPostUrl() { | ||
return postUrl; | ||
} | ||
|
||
public void setPostUrl(String postUrl) { | ||
this.postUrl = postUrl; | ||
} | ||
|
||
@Override | ||
public int compareTo(Post post) { | ||
return Integer.compare(created, post.created); | ||
} | ||
|
||
public interface Type { | ||
String GIF = "GIF"; | ||
String PHOTO_GROUP = "PHOTO_GROUP"; | ||
String PHOTO = "PHOTO"; | ||
String POLL = "POLL"; | ||
String TEXT = "TEXT"; | ||
String VIDEO = "VIDEO"; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/github/yvasyliev/model/dto/post/SpoilerablePost.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.github.yvasyliev.model.dto.post; | ||
|
||
public abstract class SpoilerablePost extends Post { | ||
|
||
private boolean hasSpoiler; | ||
|
||
public boolean isHasSpoiler() { | ||
return hasSpoiler; | ||
} | ||
|
||
public void setHasSpoiler(boolean hasSpoiler) { | ||
this.hasSpoiler = hasSpoiler; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/github/yvasyliev/model/dto/post/TextPost.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.github.yvasyliev.model.dto.post; | ||
|
||
public class TextPost extends Post { | ||
@Override | ||
public String getType() { | ||
return Type.TEXT; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/github/yvasyliev/model/dto/post/VideoPost.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.github.yvasyliev.model.dto.post; | ||
|
||
public class VideoPost extends MediaPost { | ||
@Override | ||
public String getType() { | ||
return Type.VIDEO; | ||
} | ||
} |
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
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
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
Oops, something went wrong.