Enum Class RelationshipStatusDTO

java.lang.Object
java.lang.Enum<RelationshipStatusDTO>
fr.utc.miage.sporttrack.dto.RelationshipStatusDTO
All Implemented Interfaces:
Serializable, Comparable<RelationshipStatusDTO>, Constable

public enum RelationshipStatusDTO extends Enum<RelationshipStatusDTO>
Enumeration serving as a view-layer Data Transfer Object (DTO) that represents the relationship status between two athletes within the SportTrack application.

Used by the frontend (Thymeleaf templates) to determine which action buttons to display (e.g., "Add Friend", "Cancel Request", "Block"). The value is computed from the underlying Friendship entity and FriendshipStatus.

Author:
SportTrack Team
  • Enum Constant Details

    • SELF

      public static final RelationshipStatusDTO SELF
      The current user is viewing their own profile.
    • FRIENDS

      public static final RelationshipStatusDTO FRIENDS
      Both athletes are already friends (FriendshipStatus.ACCEPTED).
    • REQUEST_SENT

      public static final RelationshipStatusDTO REQUEST_SENT
      The current user has sent a pending friend request (is the initiator).
    • REQUEST_RECEIVED

      public static final RelationshipStatusDTO REQUEST_RECEIVED
      The current user has received a pending friend request (is the recipient).
    • REJECTED

      public static final RelationshipStatusDTO REJECTED
      A friend request was previously rejected.
    • BLOCKED_BY_ME

      public static final RelationshipStatusDTO BLOCKED_BY_ME
      The current user has blocked the target user.
    • BLOCKED_ME

      public static final RelationshipStatusDTO BLOCKED_ME
      The target user has blocked the current user.
    • MUTUALLY_BLOCKED

      public static final RelationshipStatusDTO MUTUALLY_BLOCKED
      Both users have blocked each other.
    • NONE

      public static final RelationshipStatusDTO NONE
      No relationship exists between the two athletes; a friend request can be sent.
  • Method Details

    • values

      public static RelationshipStatusDTO[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RelationshipStatusDTO valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null