Enum ActivityType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ActivityType>

    public enum ActivityType
    extends java.lang.Enum<ActivityType>
    Represents an activity type.
    See Also:
    Discord docs
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      COMPETING
      Represents competing in something, represented as "Competing in Half-Life 3", for example.
      CUSTOM
      Represents a custom status, represented as "{emoji} {state}".
      LISTENING
      Represents listening to an application, represented as "Listening to Half-Life 3" for example.
      PLAYING
      Represents a normal activity, represented as "Playing Half-Life 3" for example.
      STREAMING
      Represents streaming an activity, represented as "Streaming Half-Life 3" for example.
      WATCHING
      Represents watching an application, represented as "Watching Half-Life 3", for example.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ActivityType getActivityTypeById​(int id)
      Gets the activity type by its id.
      int getId()
      Gets the id of the activity type.
      static ActivityType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ActivityType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • PLAYING

        public static final ActivityType PLAYING
        Represents a normal activity, represented as "Playing Half-Life 3" for example.
      • STREAMING

        public static final ActivityType STREAMING
        Represents streaming an activity, represented as "Streaming Half-Life 3" for example.
      • LISTENING

        public static final ActivityType LISTENING
        Represents listening to an application, represented as "Listening to Half-Life 3" for example.
      • WATCHING

        public static final ActivityType WATCHING
        Represents watching an application, represented as "Watching Half-Life 3", for example.
      • CUSTOM

        public static final ActivityType CUSTOM
        Represents a custom status, represented as "{emoji} {state}".
      • COMPETING

        public static final ActivityType COMPETING
        Represents competing in something, represented as "Competing in Half-Life 3", for example.
    • Method Detail

      • values

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

        public static ActivityType valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getId

        public int getId()
        Gets the id of the activity type.
        Returns:
        The id of the activity type.
      • getActivityTypeById

        public static ActivityType getActivityTypeById​(int id)
        Gets the activity type by its id.
        Parameters:
        id - The id of the activity type
        Returns:
        The activity type with the given id or PLAYING if unknown id.