Package com.comphenix.protocol.events
Enum Class ConnectionSide
- All Implemented Interfaces:
Serializable,Comparable<ConnectionSide>,Constable
Used to set a packet filter.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionListen for both client and server side packets.Listen for client side packets that will invoke onPacketReceiving().Listen for server side packets that will invoke onPacketSending(). -
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectionSideadd(ConnectionSide a, ConnectionSide b) If both connection sides are present, returnBOTH- otherwise, return the one valud connection side.Retrieve the sender of this connection side.booleanbooleanstatic ConnectionSideReturns the enum constant of this class with the specified name.static ConnectionSide[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SERVER_SIDE
Listen for server side packets that will invoke onPacketSending(). -
CLIENT_SIDE
Listen for client side packets that will invoke onPacketReceiving(). -
BOTH
Listen for both client and server side packets.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
isForClient
public boolean isForClient() -
isForServer
public boolean isForServer() -
getSender
Retrieve the sender of this connection side.This is NULL for
BOTH.- Returns:
- The sender.
-
add
If both connection sides are present, returnBOTH- otherwise, return the one valud connection side.NULL is not a valid connection side.
- Parameters:
a- - the first connection side.b- - the second connection side.- Returns:
- BOTH or the one valid side, or NULL.
-