Class UnsubscribePacket.UnsubscribePacketBuilder

  • Enclosing class:
    UnsubscribePacket

    public static final class UnsubscribePacket.UnsubscribePacketBuilder
    extends Object
    A class to that allows for the creation of a UnsubscribePacket. Set all of the settings you want in the packet and then use the build() function to get a UnsubscribePacket populated with the settings defined in the builder.
    • Constructor Detail

      • UnsubscribePacketBuilder

        public UnsubscribePacketBuilder()
        Creates a new UnsubscribePacketBuilder so a UnsubscribePacket can be created.
      • UnsubscribePacketBuilder

        public UnsubscribePacketBuilder​(String topicFilter)
        Creates a new UnsubscribePacketBuilder with one subscription defined.
        Parameters:
        topicFilter - A single topic filter that the client wishes to unsubscribe from.
    • Method Detail

      • withSubscription

        public UnsubscribePacket.UnsubscribePacketBuilder withSubscription​(String topicFilter)
        Sets a single topic filter that the client wishes to unsubscribe from.
        Parameters:
        topicFilter - A single topic filter that the client wishes to unsubscribe from.
        Returns:
        The UnsubscribePacketBuilder after setting the subscription.
      • build

        public UnsubscribePacket build()
        Creates a new UnsubscribePacket using the settings set in the builder.
        Returns:
        The UnsubscribePacket created from the builder