public class ListeningWhitelist
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ListeningWhitelist.Builder
Represents a builder of whitelists.
|
Modifier and Type | Field and Description |
---|---|
static ListeningWhitelist |
EMPTY_WHITELIST
A whitelist with no packets - indicates that the listener shouldn't observe any packets.
|
Constructor and Description |
---|
ListeningWhitelist(ListenerPriority priority,
java.lang.Integer... whitelist)
Deprecated.
|
ListeningWhitelist(ListenerPriority priority,
java.lang.Integer[] whitelist,
GamePhase gamePhase)
Deprecated.
|
ListeningWhitelist(ListenerPriority priority,
java.lang.Integer[] whitelist,
GamePhase gamePhase,
ListenerOptions... options)
Deprecated.
|
ListeningWhitelist(ListenerPriority priority,
java.util.Set<java.lang.Integer> whitelist)
Deprecated.
|
ListeningWhitelist(ListenerPriority priority,
java.util.Set<java.lang.Integer> whitelist,
GamePhase gamePhase)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
containsAny(ListeningWhitelist whitelist,
int... idList)
Determine if any of the given IDs can be found in the whitelist.
|
boolean |
equals(java.lang.Object obj) |
GamePhase |
getGamePhase()
Retrieve which game phase this listener is active under.
|
java.util.Set<ListenerOptions> |
getOptions()
Retrieve every special option associated with this whitelist.
|
ListenerPriority |
getPriority()
Retrieve the priority in the execution order of the packet listener.
|
java.util.Set<PacketType> |
getTypes()
Retrieves a set of the packets that will be observed by the listeners.
|
java.util.Set<java.lang.Integer> |
getWhitelist()
Deprecated.
|
int |
hashCode() |
static boolean |
isEmpty(ListeningWhitelist whitelist)
Determine if the given whitelist is empty or not.
|
boolean |
isEnabled()
Whether or not this whitelist has any enabled packets.
|
static ListeningWhitelist.Builder |
newBuilder()
Construct a new builder of whitelists.
|
static ListeningWhitelist.Builder |
newBuilder(ListeningWhitelist template)
Construct a new builder of whitelists initialized to the same values as the template.
|
java.lang.String |
toString() |
public static final ListeningWhitelist EMPTY_WHITELIST
@Deprecated public ListeningWhitelist(ListenerPriority priority, java.util.Set<java.lang.Integer> whitelist)
Deprecated: Use newBuilder()
instead.
priority
- - the listener priority.whitelist
- - set of IDs to observe/enable.@Deprecated public ListeningWhitelist(ListenerPriority priority, java.util.Set<java.lang.Integer> whitelist, GamePhase gamePhase)
Deprecated: Use newBuilder()
instead.
priority
- - the listener priority.whitelist
- - set of IDs to observe/enable.gamePhase
- - which game phase to receieve notifications on.@Deprecated public ListeningWhitelist(ListenerPriority priority, java.lang.Integer... whitelist)
Deprecated: Use newBuilder()
instead.
priority
- - the listener priority.whitelist
- - list of packet IDs to observe/enable.@Deprecated public ListeningWhitelist(ListenerPriority priority, java.lang.Integer[] whitelist, GamePhase gamePhase)
Deprecated: Use newBuilder()
instead.
priority
- - the listener priority.whitelist
- - list of packet IDs to observe/enable.gamePhase
- - which game phase to receieve notifications on.@Deprecated public ListeningWhitelist(ListenerPriority priority, java.lang.Integer[] whitelist, GamePhase gamePhase, ListenerOptions... options)
Deprecated: Use newBuilder()
instead.
priority
- - the listener priority.whitelist
- - list of packet IDs to observe/enable.gamePhase
- - which game phase to receieve notifications on.options
- - every special option associated with this whitelist.public boolean isEnabled()
public ListenerPriority getPriority()
@Deprecated public java.util.Set<java.lang.Integer> getWhitelist()
Deprecated: Use getTypes()
instead.
public java.util.Set<PacketType> getTypes()
public GamePhase getGamePhase()
public java.util.Set<ListenerOptions> getOptions()
public int hashCode()
hashCode
in class java.lang.Object
public static boolean containsAny(ListeningWhitelist whitelist, int... idList)
whitelist
- - whitelist to test.idList
- - list of packet IDs to find.public static boolean isEmpty(ListeningWhitelist whitelist)
whitelist
- - the whitelist to test.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static ListeningWhitelist.Builder newBuilder()
public static ListeningWhitelist.Builder newBuilder(ListeningWhitelist template)
template
- - the template object.