Package devs.beer.nativepackets.api
Class PacketType<V extends PacketView>
java.lang.Object
devs.beer.nativepackets.api.PacketType<V>
- Type Parameters:
V- lazy packet view type
Stable semantic packet type with a compact runtime index.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V extends PacketView>
PacketType<V> create(int index, String key, PacketDirection direction, ProtocolPhase phase, Class<V> viewType) Creates a generated or adapter-declared semantic packet type.Returns the declared direction.intindex()Returns the compact lookup index.key()Returns the stable semantic key.phase()Returns the declared phase.toString()viewType()Returns the lazy view contract.
-
Method Details
-
create
public static <V extends PacketView> PacketType<V> create(int index, String key, PacketDirection direction, ProtocolPhase phase, Class<V> viewType) Creates a generated or adapter-declared semantic packet type.- Type Parameters:
V- lazy packet view type- Parameters:
index- compact lookup indexkey- stable semantic keydirection- packet directionphase- protocol phaseviewType- lazy view contract- Returns:
- immutable packet type
-
index
public int index()Returns the compact lookup index.- Returns:
- compact index
-
key
Returns the stable semantic key.- Returns:
- semantic key
-
direction
Returns the declared direction.- Returns:
- packet direction
-
phase
Returns the declared phase.- Returns:
- protocol phase
-
viewType
Returns the lazy view contract.- Returns:
- view type
-
toString
-