Class IndexedMessageCodec.MessageHandler<MSG>

  • Enclosing class:
    IndexedMessageCodec

    class IndexedMessageCodec.MessageHandler<MSG>
    extends java.lang.Object
    • Field Detail

      • encoder

        private final java.util.Optional<java.util.function.BiConsumer<MSG,​PacketBuffer>> encoder
      • decoder

        private final java.util.Optional<java.util.function.Function<PacketBuffer,​MSG>> decoder
      • index

        private final int index
      • messageConsumer

        private final java.util.function.BiConsumer<MSG,​java.util.function.Supplier<NetworkEvent.Context>> messageConsumer
      • messageType

        private final java.lang.Class<MSG> messageType
      • networkDirection

        private final java.util.Optional<NetworkDirection> networkDirection
      • loginIndexSetter

        private java.util.Optional<java.util.function.BiConsumer<MSG,​java.lang.Integer>> loginIndexSetter
      • loginIndexGetter

        private java.util.Optional<java.util.function.Function<MSG,​java.lang.Integer>> loginIndexGetter
    • Constructor Detail

      • MessageHandler

        public MessageHandler​(int index,
                              java.lang.Class<MSG> messageType,
                              java.util.function.BiConsumer<MSG,​PacketBuffer> encoder,
                              java.util.function.Function<PacketBuffer,​MSG> decoder,
                              java.util.function.BiConsumer<MSG,​java.util.function.Supplier<NetworkEvent.Context>> messageConsumer,
                              java.util.Optional<NetworkDirection> networkDirection)
    • Method Detail

      • setLoginIndexSetter

        void setLoginIndexSetter​(java.util.function.BiConsumer<MSG,​java.lang.Integer> loginIndexSetter)
      • getLoginIndexSetter

        java.util.Optional<java.util.function.BiConsumer<MSG,​java.lang.Integer>> getLoginIndexSetter()
      • setLoginIndexGetter

        void setLoginIndexGetter​(java.util.function.Function<MSG,​java.lang.Integer> loginIndexGetter)
      • getLoginIndexGetter

        public java.util.Optional<java.util.function.Function<MSG,​java.lang.Integer>> getLoginIndexGetter()
      • newInstance

        MSG newInstance()