adapted for messages

This commit is contained in:
Massimiliano Assante 2022-04-06 16:05:40 +02:00
parent 5c79f453b2
commit b25e841aff
3 changed files with 33 additions and 3 deletions

View File

@ -57,6 +57,10 @@
<version>[1.16.0, 2.0.0)</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>storagehub-model</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-bean-validation</artifactId>
@ -113,7 +117,7 @@
<target>${java_version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -10,7 +10,7 @@ import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Used for serialization of {@link org.gcube.common.homelibrary.home.workspace.sharing.WorkspaceMessage}
* Used for serialization
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@ -141,4 +141,4 @@ public class Message {
+ sendTime + ", read=" + read + ", attachmentIds="
+ attachmentIds + ", recipients=" + recipients + "]";
}
}
}

View File

@ -0,0 +1,26 @@
package org.gcube.social_networking.socialnetworking.model.beans;
import java.util.*;
import org.gcube.common.storagehub.model.items.nodes.Owner;
/**
* Used for serialization
*/
public class MessageInbox extends org.gcube.common.storagehub.model.messages.Message {
//needed for serialization
public MessageInbox() {
super();
}
@Override
public String toString() {
String body = (getBody() != null && getBody().length() > 10) ? getBody().substring(0, 9) + " ..." : "empty or short body";
String usernameSender = getSender() != null ? getSender().getUserName() : "uknwnown";
return "Message getSenderUsername()=" + usernameSender + ", getSubject()=" + getSubject() + ", getBody()=" + body + ", isRead()=" + isRead()
+ ", isOpened()=" + isOpened() + ", getAddresses()=" + Arrays.toString(getAddresses())
+ ", getCreationTime()=" + getCreationTime() + ", getId()="
+ getId() + ", getName()=" + getName() + ", getPrimaryType()=" + getPrimaryType() + "]";
}
}