Enum Affiliation

  • All Implemented Interfaces:
    Serializable, Comparable<Affiliation>

    public enum Affiliation
    extends Enum<Affiliation>
    A long-lived association or connection with a room; the possible affiliations are "owner", "admin", "member", and "outcast" (naturally it is also possible to have no affiliation); affiliation is distinct from role. An affiliation lasts across a user's visits to a room.
    See Also:
    5.2 Affiliations
    • Enum Constant Detail

      • OWNER

        public static final Affiliation OWNER
        The owner affiliation.
      • ADMIN

        public static final Affiliation ADMIN
        The admin affiliation.
      • MEMBER

        public static final Affiliation MEMBER
        The member affiliation.
      • NONE

        public static final Affiliation NONE
        No affiliation.
      • OUTCAST

        public static final Affiliation OUTCAST
        The outcast affiliation.
    • Method Detail

      • values

        public static Affiliation[] 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 (Affiliation c : Affiliation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Affiliation 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
      • isHigherThan

        public final boolean isHigherThan​(Affiliation affiliation)
        Compares two affiliations and returns true, if this affiliation is higher than the other with regards to their privileges in a multi-user chat.

        The highest affiliation is owner, followed by admin, followed by member, followed by none and then outcast.

        Parameters:
        affiliation - The other affiliation.
        Returns:
        True, if this affiliation is higher than the other.