social-service-model/src/main/java/org/gcube/social_networking/socialnetworking/model/beans/WorkspaceNotification.java

32 lines
1.1 KiB
Java
Raw Normal View History

package org.gcube.social_networking.socialnetworking.model.beans;
2022-05-03 16:42:30 +02:00
import javax.validation.constraints.NotNull;
2022-04-29 14:52:03 +02:00
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
2022-05-03 16:42:30 +02:00
import com.fasterxml.jackson.annotation.JsonProperty;
2022-05-02 18:46:40 +02:00
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
2022-04-29 14:52:03 +02:00
2022-05-02 18:46:40 +02:00
/**
* The WorkspaceNotification super class
*/
2022-04-29 14:52:03 +02:00
@JsonIgnoreProperties(ignoreUnknown = true)
2022-05-02 18:46:40 +02:00
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME,
include = As.PROPERTY, property = "type") @JsonSubTypes({
@JsonSubTypes.Type(value = WorkspaceNotificationSharedFolder.class, name = "FOLDER_SHARE"),
@JsonSubTypes.Type(value = WorkspaceNotificationUnsharedFolder.class, name = "FOLDER_UNSHARE"),
@JsonSubTypes.Type(value = WorkspaceNotificationAddedItem.class, name = "ITEM_NEW")
})
public abstract class WorkspaceNotification {
2022-05-03 16:42:30 +02:00
protected final WorkspaceNotificationType TYPE;
2022-05-02 18:46:40 +02:00
2022-05-03 16:42:30 +02:00
WorkspaceNotification(WorkspaceNotificationType TYPE) {
this.TYPE = TYPE;
}
2022-05-02 18:46:40 +02:00
2022-05-03 16:42:30 +02:00
public WorkspaceNotificationType TYPE() {
return TYPE;
}
}