Package org.jivesoftware.smack.packet
Enum Presence.Mode
- java.lang.Object
-
- java.lang.Enum<Presence.Mode>
-
- org.jivesoftware.smack.packet.Presence.Mode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Presence.Mode>
- Enclosing class:
- Presence
public static enum Presence.Mode extends java.lang.Enum<Presence.Mode>
An enum to represent the presence mode.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Presence.Mode
fromString(java.lang.String string)
Converts a String into the corresponding types.static Presence.Mode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Presence.Mode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
chat
public static final Presence.Mode chat
Free to chat.
-
available
public static final Presence.Mode available
Available (the default).
-
away
public static final Presence.Mode away
Away.
-
xa
public static final Presence.Mode xa
Away for an extended period of time.
-
dnd
public static final Presence.Mode dnd
Do not disturb.
-
-
Method Detail
-
values
public static Presence.Mode[] 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 (Presence.Mode c : Presence.Mode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Presence.Mode 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 namejava.lang.NullPointerException
- if the argument is null
-
fromString
public static Presence.Mode fromString(java.lang.String string)
Converts a String into the corresponding types. Valid String values that can be converted to types are: "chat", "available", "away", "xa", and "dnd".- Parameters:
string
- the String value to covert.- Returns:
- the corresponding Type.
- Throws:
java.lang.IllegalArgumentException
- when not able to parse the string parameterjava.lang.NullPointerException
- if the string is null
-
-