Class AddressHandlerAdapter<A>

java.lang.Object
org.drasyl.pipeline.HandlerAdapter
org.drasyl.pipeline.AddressHandlerAdapter<A>
Type Parameters:
A - the type of the Address.
All Implemented Interfaces:
Handler
Direct Known Subclasses:
SimpleInboundHandler, SimpleOutboundHandler

public abstract class AddressHandlerAdapter<A> extends HandlerAdapter
HandlerAdapter which allows to explicit only handle a specific type of address.
  • Constructor Details

    • AddressHandlerAdapter

      protected AddressHandlerAdapter()
      Create a new instance which will try to detect the types to match out of the type parameter of the class.
    • AddressHandlerAdapter

      protected AddressHandlerAdapter(Class<? extends A> addressType)
      Create a new instance
      Parameters:
      addressType - the type of messages to match
  • Method Details

    • acceptAddress

      protected boolean acceptAddress(Address address)
      Returns true if the given address should be handled, false otherwise.