Class UnsubscribePacket.UnsubscribePacketBuilder
java.lang.Object
software.amazon.awssdk.crt.mqtt5.packets.UnsubscribePacket.UnsubscribePacketBuilder
- Enclosing class:
- UnsubscribePacket
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 Summary
ConstructorsConstructorDescriptionCreates a new UnsubscribePacketBuilder so a UnsubscribePacket can be created.UnsubscribePacketBuilder(String topicFilter) Creates a new UnsubscribePacketBuilder with one subscription defined. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a new UnsubscribePacket using the settings set in the builder.withSubscription(String topicFilter) Sets a single topic filter that the client wishes to unsubscribe from.withUserProperties(List<UserProperty> userProperties) Sets the list of MQTT5 user properties included with the packet.
-
Constructor Details
-
UnsubscribePacketBuilder
public UnsubscribePacketBuilder()Creates a new UnsubscribePacketBuilder so a UnsubscribePacket can be created. -
UnsubscribePacketBuilder
Creates a new UnsubscribePacketBuilder with one subscription defined.- Parameters:
topicFilter- A single topic filter that the client wishes to unsubscribe from.
-
-
Method Details
-
withSubscription
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.
-
withUserProperties
public UnsubscribePacket.UnsubscribePacketBuilder withUserProperties(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
Creates a new UnsubscribePacket using the settings set in the builder.- Returns:
- The UnsubscribePacket created from the builder
-