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