From 6fe45d9827e6fdfa14df8858e487e506f74a5cdf Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Thu, 16 May 2024 15:24:33 +0200 Subject: [PATCH] new resources --- .../model/shared/Hashtag.java | 64 +++++++++++++++++++ .../model/shared/NotificationPreference.java | 55 ++++++++++++++++ .../model/shared/Resource.java | 7 ++ .../socialnetworking/model/shared/Vre.java | 43 +++++++++++++ 4 files changed, 169 insertions(+) create mode 100644 src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Hashtag.java create mode 100644 src/main/java/org/gcube/social_networking/socialnetworking/model/shared/NotificationPreference.java create mode 100644 src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Resource.java create mode 100644 src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Vre.java diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Hashtag.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Hashtag.java new file mode 100644 index 0000000..841b1bc --- /dev/null +++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Hashtag.java @@ -0,0 +1,64 @@ +package org.gcube.social_networking.socialnetworking.model.shared; + +import java.io.Serializable; + +@SuppressWarnings("serial") +public class Hashtag extends Resource implements Serializable{ + + private String hashtag; + private int occurrence; + + /** + * + */ + public Hashtag() { + super(); + } + /** + * + * @param hashtag + */ + public Hashtag(String hashtag) { + super(); + this.hashtag = hashtag; + this.occurrence = 0; + } + + /** + * + * @param hashtag + * @param occurrence + */ + public Hashtag(String hashtag, int occurrence) { + super(); + this.hashtag = hashtag; + this.occurrence = occurrence; + } + + + @Override + public String toString() { + return "Hashtag [hashtag=" + hashtag + ", occurrence=" + occurrence + "]"; + } + + public void setOccurrence(int occurrence){ + this.occurrence = occurrence; + } + public int getOccurrence(){ + return this.occurrence; + } + + + @Override + public String getId() { + return hashtag; + } + public String getHashtag() { + return hashtag; + } + + public void setHashtag(String hashtag){ + this.hashtag = hashtag; + } +} + diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/NotificationPreference.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/NotificationPreference.java new file mode 100644 index 0000000..aea451e --- /dev/null +++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/NotificationPreference.java @@ -0,0 +1,55 @@ +package org.gcube.social_networking.socialnetworking.model.shared; + +import java.io.Serializable; +import java.util.Arrays; + +public class NotificationPreference extends Resource implements Serializable { + private String notificationType; + private String[] notificationChannelType; + + /** + * + */ + public NotificationPreference() { + super(); + } + /** + * + * @param notificationType + * @param notificationChannelType + */ + public NotificationPreference(String notificationType, String... notificationChannelType) { + super(); + this.notificationType = notificationType; + this.notificationChannelType = notificationChannelType; + } + + + + @Override + public String toString() { + return "NotificationPreference [notificationtype=" + notificationType + ", notificationChannelType=" + Arrays.toString(notificationChannelType) + "]"; + } + + public String getNotificationType() { + return notificationType; + } + + public void setNotificationChannelType(String[] notificationChannelType) { + this.notificationChannelType = notificationChannelType; + } + + public void setNotificationType(String notificationType) { + this.notificationType = notificationType; + } + + public String[] getNotificationChannelType() { + return notificationChannelType; + } + + @Override + public String getId() { + return notificationType; + } + +} diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Resource.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Resource.java new file mode 100644 index 0000000..a3038e1 --- /dev/null +++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Resource.java @@ -0,0 +1,7 @@ +package org.gcube.social_networking.socialnetworking.model.shared; + +public abstract class Resource { + + public abstract String getId(); + +} diff --git a/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Vre.java b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Vre.java new file mode 100644 index 0000000..e287aa0 --- /dev/null +++ b/src/main/java/org/gcube/social_networking/socialnetworking/model/shared/Vre.java @@ -0,0 +1,43 @@ +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{ + + private String vreid; + + /** + * + */ + public Vre() { + super(); + } + /** + * + * @param vreid + */ + public Vre(String vreid) { + super(); + this.vreid = vreid; + + } + + + @Override + public String toString() { + return "Vre [vreid=" + vreid + "]"; + } + + + @Override + public String getId() { + return vreid; + } + + public void setId(String vreid){ + this.vreid = vreid; + } +} +