Class UnsubscribePacket.UnsubscribePacketBuilder

  • Enclosing class:
    UnsubscribePacket

    public static final class UnsubscribePacket.UnsubscribePacketBuilder
    extends java.lang.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.
    • Method Detail

      • withSubscription

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

        public UnsubscribePacket.UnsubscribePacketBuilder withUserProperties​(java.util.List<UserProperty> userProperties)
        Sets the list of MQTT5 user properties included with the packet. See MQTT5 User Property
        Parameters:
        userProperties - List of MQTT5 user properties included with the packet.
        Returns:
        The UnsubscribePacketBuilder after setting the user properties.
      • build

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