Interface ModifiableUserProperties
-
- All Superinterfaces:
UserProperties
@DoNotImplement public interface ModifiableUserProperties extends UserProperties
Interface to modifyUserProperties
received from any MQTT packet.- Since:
- 4.0.0, CE 2019.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addUserProperty(@NotNull UserProperty userProperty)
Add a newUserProperty
.void
addUserProperty(@NotNull String name, @NotNull String value)
Add a newUserProperty
.void
clear()
Removes all user properties.@NotNull List<@NotNull UserProperty>
removeName(@NotNull String name)
Remove everyUserProperty
with the specified name.void
removeUserProperty(@NotNull String name, @NotNull String value)
Remove aUserProperty
.-
Methods inherited from interface com.hivemq.extension.sdk.api.packets.general.UserProperties
asList, getAllForName, getFirst, isEmpty
-
-
-
-
Method Detail
-
addUserProperty
void addUserProperty(@NotNull UserProperty userProperty)
Add a newUserProperty
.- Parameters:
userProperty
- The user property to add.- Throws:
NullPointerException
- If userProperty is null.NullPointerException
- If the user property's name or value is null.IllegalArgumentException
- If the user property's name or value is not a valid UTF-8 string.IllegalArgumentException
- If the user property's name or value exceeds the UTF-8 string length limit.DoNotImplementException
- If theUserProperty
is implemented by the extension.- Since:
- 4.0.0, CE 2019.1
-
addUserProperty
void addUserProperty(@NotNull String name, @NotNull String value)
Add a newUserProperty
.- Parameters:
name
- The name of the user property to add.value
- The name of the user property to add.- Throws:
NullPointerException
- If the name or value is null.IllegalArgumentException
- If the name or value is not a valid UTF-8 string.IllegalArgumentException
- If the name or value exceeds the UTF-8 string length limit.- Since:
- 4.0.0, CE 2019.1
-
removeUserProperty
void removeUserProperty(@NotNull String name, @NotNull String value)
Remove aUserProperty
.- Parameters:
name
- The name of the user property to remove.value
- The value of the user property to remove.- Throws:
NullPointerException
- If the name or value is null.IllegalArgumentException
- If the name or value is not a valid UTF-8 string.IllegalArgumentException
- If the name or value exceeds the UTF-8 string length limit.- Since:
- 4.0.0, CE 2019.1
-
removeName
@NotNull List<@NotNull UserProperty> removeName(@NotNull String name)
Remove everyUserProperty
with the specified name.- Parameters:
name
- The name of the user properties to remove.- Returns:
- A list of the removed user properties.
- Throws:
NullPointerException
- If the name is null.IllegalArgumentException
- If the name is not a valid UTF-8 string.IllegalArgumentException
- If the name exceeds the UTF-8 string length limit.- Since:
- 4.0.0, CE 2019.1
-
clear
void clear()
Removes all user properties.- Since:
- 4.0.0, CE 2019.1
-
-