Class NetworkChannelInitEvent
java.lang.Object
eu.cloudnetservice.driver.event.Event
eu.cloudnetservice.driver.event.events.network.NetworkEvent
eu.cloudnetservice.driver.event.events.network.NetworkChannelInitEvent
- All Implemented Interfaces:
Cancelable
An event being fired when a network channel get initialized either on the client or server side.
- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNetworkChannelInitEvent(@NonNull NetworkChannel channel, @NonNull ChannelType channelType) Creates a new instance of this network event. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the cancellation state of the event.voidcancelled(boolean cancelled) Marks this event as cancelled and stops the execution of the representing change in the system.Get the type of channel getting initialized.Methods inherited from class NetworkEvent
networkChannel
-
Field Details
-
channelType
-
cancelled
private boolean cancelled
-
-
Constructor Details
-
NetworkChannelInitEvent
public NetworkChannelInitEvent(@NonNull @NonNull NetworkChannel channel, @NonNull @NonNull ChannelType channelType) Creates a new instance of this network event.- Parameters:
channel- the channel which is associated with this event.channelType- the type of channel being initialized.- Throws:
NullPointerException- if the given channel or type is null.
-
-
Method Details
-
channelType
Get the type of channel getting initialized.- Returns:
- the type of channel getting initialized.
-
cancelled
public boolean cancelled()Gets the cancellation state of the event. A cancelled event will stop the execution of the representing change in the system, but will be passed to all event listeners nevertheless.- Specified by:
cancelledin interfaceCancelable- Returns:
- true if this is cancelled, false otherwise.
-
cancelled
public void cancelled(boolean cancelled) Marks this event as cancelled and stops the execution of the representing change in the system. The event will be passed to other event listeners down the line anyway.- Specified by:
cancelledin interfaceCancelable- Parameters:
cancelled- true if this event should get marked as cancelled, false otherwise.
-