java.lang.Object
com.finconsgroup.itserr.marketplace.core.entity.AbstractUUIDEntity
com.finconsgroup.itserr.marketplace.usercommunication.dm.entity.Conversation

@Entity public class Conversation extends com.finconsgroup.itserr.marketplace.core.entity.AbstractUUIDEntity
Entity representing a conversation that can be: - DIRECT: 1-on-1 chat between two users (LinkedIn-style) - GROUP: Private group chat with invited members
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.finconsgroup.itserr.marketplace.core.entity.AbstractUUIDEntity

    com.finconsgroup.itserr.marketplace.core.entity.AbstractUUIDEntity.AbstractUUIDEntityBuilder<C extends com.finconsgroup.itserr.marketplace.core.entity.AbstractUUIDEntity,B extends com.finconsgroup.itserr.marketplace.core.entity.AbstractUUIDEntity.AbstractUUIDEntityBuilder<C,B>>
  • Constructor Summary

    Constructors
    Constructor
    Description
    Conversation(UUID conversationId, ConversationType conversationType, UUID createdBy)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    createDirectConversation(UUID conversationId, UUID user1Id, UUID user2Id)
     
    createGroupConversation(UUID conversationId, String name, UUID createdBy)
     
    For direct conversations, get the other participant's ID
    boolean
     
    boolean
    For direct conversations, check if a user is one of the two participants
    boolean
     
    void
     

    Methods inherited from class com.finconsgroup.itserr.marketplace.core.entity.AbstractUUIDEntity

    builder, canEqual, equals, getId, hashCode, setId, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • prePersist

      public void prePersist()
      Overrides:
      prePersist in class com.finconsgroup.itserr.marketplace.core.entity.AbstractUUIDEntity
    • createDirectConversation

      public static Conversation createDirectConversation(UUID conversationId, UUID user1Id, UUID user2Id)
    • createGroupConversation

      public static Conversation createGroupConversation(UUID conversationId, String name, UUID createdBy)
    • isDirect

      public boolean isDirect()
    • isGroup

      public boolean isGroup()
    • isDirectParticipant

      public boolean isDirectParticipant(UUID userId)
      For direct conversations, check if a user is one of the two participants
    • getOtherParticipantId

      public UUID getOtherParticipantId(UUID userId)
      For direct conversations, get the other participant's ID