Enum MembershipStatus

  • All Implemented Interfaces:
    Serializable, Comparable<MembershipStatus>

    public enum MembershipStatus
    extends Enum<MembershipStatus>

    It defines the status of the membership of a user to a community of users. By its values, it defines the different steps a membership can pass:

    • first, a user asks to join a community of users. If the membership requires validation, the membership of the user is pending.
    • If no validation is required for a membership application or if a pending membership is validated, the membership of the user to the community of users is then committed.
    • In the case of a validation, the application for membership can be refused.
    • After a time, the user can remove himself from the community of users (or he can be retired by an administrator), in this case his membership is removed.
    Author:
    mmoquillon
    • Enum Constant Detail

      • PENDING

        public static final MembershipStatus PENDING
        The user asked to join the community of users and his membership is pending, waiting for validation by a validator.
      • COMMITTED

        public static final MembershipStatus COMMITTED
        The user is currently member of the community of users.
      • REFUSED

        public static final MembershipStatus REFUSED
        The asking of a user to join the community of users has been refused by a validator. The membership of the user to the community is stated as refused.
      • REMOVED

        public static final MembershipStatus REMOVED
        The user isn't anymore a member of the community of users. He either retired himself or he has been removed from the community. His membership isn't deleted, just the status is updated.
    • Method Detail

      • values

        public static MembershipStatus[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MembershipStatus c : MembershipStatus.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MembershipStatus valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • isPending

        public boolean isPending()
        Is the membership to the community of user pending for validation by a validator?
        Returns:
        true if the membership of the user to the community is waiting for validation. False otherwise.
      • isMember

        public boolean isMember()
        Is the membership to the community of users is committed?
        Returns:
        true if the user is an actual member of the community. False otherwise.
      • isRefused

        public boolean isRefused()
        Is the membership to the community of users has been refused?
        Returns:
        true if the membership asking of the user has been refused by a validator. False otherwise.
      • isNoMoreMember

        public boolean isNoMoreMember()
        Is the membership to the community of users has been removed?
        Returns:
        true if the user isn't anymore a member of the community. False otherwise.