Class PropertyBag


  • public final class PropertyBag
    extends Object
    A collection of methods for processing a property-bag set at the end of a topic.
    • Method Detail

      • fromTopic

        public static PropertyBag fromTopic​(String topic)
        Creates a property bag object from a topic.

        The properties are retrieved from the topic by means of parsing the topic after the last occurrence of /? as an HTTP query string.

        Note: The given topic must have a non-empty first path segment, otherwise null will be returned.

        Parameters:
        topic - The topic that the message has been published to.
        Returns:
        The property bag (which may have no properties) or null if the topic path is empty or has an empty first segment or the property bag part is invalid.
        Throws:
        NullPointerException - if topic is null.
      • getProperty

        public String getProperty​(String name)
        Gets a property value from the property-bag.

        The case sensitivity of the property names are ignored while fetching a property value.

        Parameters:
        name - The property name.
        Returns:
        The property value or null if the property is not set.
      • getPropertiesIterator

        public Iterator<Map.Entry<String,​String>> getPropertiesIterator()
        Gets an iterator iterating over the properties.
        Returns:
        The properties iterator.
      • topicWithoutPropertyBag

        public org.eclipse.hono.util.ResourceIdentifier topicWithoutPropertyBag()
        Returns the topic without the property-bag.
        Returns:
        The topic without the property-bag.