small refactor. now working
This commit is contained in:
parent
6fe45d9827
commit
d3cb7a0882
|
@ -5,7 +5,7 @@ import java.io.Serializable;
|
|||
import org.jsonmaker.gwt.client.Jsonizer;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class Attachment implements Serializable {
|
||||
public class Attachment implements Serializable, IdResource {
|
||||
|
||||
public interface AttachmentJsonizer extends Jsonizer {}
|
||||
|
||||
|
@ -42,9 +42,11 @@ public class Attachment implements Serializable {
|
|||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUri() {
|
||||
return uri;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.util.Date;
|
|||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Comment implements Serializable, Comparable<Comment> {
|
||||
public class Comment implements Serializable, Comparable<Comment>, IdResource {
|
||||
|
||||
private String key;
|
||||
private String userid;
|
||||
|
@ -28,6 +28,7 @@ public class Comment implements Serializable, Comparable<Comment> {
|
|||
public Comment() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param key
|
||||
|
@ -55,6 +56,7 @@ public class Comment implements Serializable, Comparable<Comment> {
|
|||
|
||||
/**
|
||||
* Constructor for edited comment
|
||||
*
|
||||
* @param key
|
||||
* @param userid
|
||||
* @param time
|
||||
|
@ -86,6 +88,7 @@ public class Comment implements Serializable, Comparable<Comment> {
|
|||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param text text to add as string
|
||||
|
@ -93,6 +96,7 @@ public class Comment implements Serializable, Comparable<Comment> {
|
|||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the uuid
|
||||
|
@ -148,15 +152,19 @@ public class Comment implements Serializable, Comparable<Comment> {
|
|||
public boolean isEdit() {
|
||||
return isEdit;
|
||||
}
|
||||
|
||||
public void setEdit(boolean isEdit) {
|
||||
this.isEdit = isEdit;
|
||||
}
|
||||
|
||||
public Date getLastEditTime() {
|
||||
return lastEditTime;
|
||||
}
|
||||
|
||||
public void setLastEditTime(Date lastEditTime) {
|
||||
this.lastEditTime = lastEditTime;
|
||||
}
|
||||
|
||||
public int compareTo(Comment toCompare) {
|
||||
if (this.time.after(toCompare.getTime()))
|
||||
return 1;
|
||||
|
@ -172,4 +180,9 @@ public class Comment implements Serializable, Comparable<Comment> {
|
|||
+ fullName + ", thumbnailURL=" + thumbnailURL + ", isEdit="
|
||||
+ isEdit + ", lastEditTime=" + lastEditTime + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package org.gcube.social_networking.socialnetworking.model.shared;
|
|||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class Hashtag extends Resource implements Serializable{
|
||||
public class Hashtag implements IdResource, Serializable{
|
||||
|
||||
private String hashtag;
|
||||
private int occurrence;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.gcube.social_networking.socialnetworking.model.shared;
|
||||
|
||||
public abstract class Resource {
|
||||
|
||||
public abstract String getId();
|
||||
public interface IdResource {
|
||||
public String getId();
|
||||
|
||||
}
|
|
@ -2,13 +2,14 @@ package org.gcube.social_networking.socialnetworking.model.shared;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Massimiliano Assante, ISTI-CNR
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Invite implements Serializable {
|
||||
public class Invite implements Serializable, IdResource {
|
||||
|
||||
private String key;
|
||||
private String senderUserId;
|
||||
|
@ -19,14 +20,15 @@ public class Invite implements Serializable {
|
|||
private Date time;
|
||||
private String senderFullName;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public Invite() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public Invite(String key, String senderUserId, String vreid,
|
||||
String invitedEmail, String controlCode, InviteStatus status,
|
||||
Date time, String senderFullName) {
|
||||
|
@ -41,95 +43,70 @@ public class Invite implements Serializable {
|
|||
this.senderFullName = senderFullName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String getSenderUserId() {
|
||||
return senderUserId;
|
||||
}
|
||||
|
||||
|
||||
public void setSenderUserId(String senderUserId) {
|
||||
this.senderUserId = senderUserId;
|
||||
}
|
||||
|
||||
|
||||
public String getVreid() {
|
||||
return vreid;
|
||||
}
|
||||
|
||||
|
||||
public void setVreid(String vreid) {
|
||||
this.vreid = vreid;
|
||||
}
|
||||
|
||||
|
||||
public String getInvitedEmail() {
|
||||
return invitedEmail;
|
||||
}
|
||||
|
||||
|
||||
public void setInvitedEmail(String invitedEmail) {
|
||||
this.invitedEmail = invitedEmail;
|
||||
}
|
||||
|
||||
|
||||
public String getControlCode() {
|
||||
return controlCode;
|
||||
}
|
||||
|
||||
|
||||
public void setControlCode(String controlCode) {
|
||||
this.controlCode = controlCode;
|
||||
}
|
||||
|
||||
|
||||
public InviteStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
public void setStatus(InviteStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
public Date getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
|
||||
public void setTime(Date time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
|
||||
public String getSenderFullName() {
|
||||
return senderFullName;
|
||||
}
|
||||
|
||||
|
||||
public void setSenderFullName(String senderFullName) {
|
||||
this.senderFullName = senderFullName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Invite [key=" + key + ", senderUserId=" + senderUserId
|
||||
|
@ -138,7 +115,4 @@ public class Invite implements Serializable {
|
|||
+ ", time=" + time + ", senderFullName=" + senderFullName + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.Date;
|
|||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Like implements Serializable {
|
||||
public class Like implements Serializable, IdResource {
|
||||
|
||||
private String key;
|
||||
private String userid;
|
||||
|
@ -18,6 +18,11 @@ public class Like implements Serializable {
|
|||
private String fullName;
|
||||
private String thumbnailURL;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public Like() {
|
||||
super();
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.Date;
|
|||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Notification implements Serializable {
|
||||
public class Notification implements Serializable, IdResource {
|
||||
|
||||
private String key;
|
||||
private NotificationType type;
|
||||
|
@ -190,4 +190,11 @@ public class Notification implements Serializable {
|
|||
+ senderFullName + ", senderThumbnail=" + senderThumbnail
|
||||
+ ", commentKey=" + commentKey + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return this.key;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package org.gcube.social_networking.socialnetworking.model.shared;
|
|||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class NotificationPreference extends Resource implements Serializable {
|
||||
public class NotificationPreference implements Serializable, IdResource {
|
||||
private String notificationType;
|
||||
private String[] notificationChannelType;
|
||||
|
||||
|
@ -13,6 +13,7 @@ public class NotificationPreference extends Resource implements Serializable {
|
|||
public NotificationPreference() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param notificationType
|
||||
|
@ -24,11 +25,10 @@ public class NotificationPreference extends Resource implements Serializable {
|
|||
this.notificationChannelType = notificationChannelType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NotificationPreference [notificationtype=" + notificationType + ", notificationChannelType=" + Arrays.toString(notificationChannelType) + "]";
|
||||
return "NotificationPreference [notificationtype=" + notificationType + ", notificationChannelType="
|
||||
+ Arrays.toString(notificationChannelType) + "]";
|
||||
}
|
||||
|
||||
public String getNotificationType() {
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.Date;
|
|||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Post implements Serializable, Comparable<Post> {
|
||||
public class Post implements Serializable, Comparable<Post>, IdResource {
|
||||
|
||||
private String key;
|
||||
private PostType type;
|
||||
|
@ -29,6 +29,10 @@ public class Post implements Serializable, Comparable<Post> {
|
|||
private String linkDescription;
|
||||
private String linkHost;
|
||||
boolean applicationPost;
|
||||
|
||||
public String getId(){
|
||||
return this.key;
|
||||
}
|
||||
/**
|
||||
* this boolean indicates that the attachments to the post are > 1
|
||||
*/
|
||||
|
|
|
@ -4,10 +4,14 @@ import java.io.Serializable;
|
|||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class PostWithAttachment implements Serializable {
|
||||
public class PostWithAttachment implements IdResource, Serializable{
|
||||
private Post post;
|
||||
private List<Attachment> attachments;
|
||||
|
||||
public String getId(){
|
||||
return this.post.getId();
|
||||
}
|
||||
|
||||
public PostWithAttachment(Post post, List<Attachment> attachments){
|
||||
super();
|
||||
this.post = post;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package org.gcube.social_networking.socialnetworking.model.shared;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class Vre extends Resource implements Serializable{
|
||||
public class Vre implements IdResource, Serializable {
|
||||
|
||||
private String vreid;
|
||||
|
||||
|
@ -14,6 +13,7 @@ public class Vre extends Resource implements Serializable{
|
|||
public Vre() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param vreid
|
||||
|
@ -24,20 +24,17 @@ public class Vre extends Resource implements Serializable{
|
|||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Vre [vreid=" + vreid + "]";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return vreid;
|
||||
}
|
||||
|
||||
public void setId(String vreid){
|
||||
public void setId(String vreid) {
|
||||
this.vreid = vreid;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue