Interface TopicPath


  • public interface TopicPath
    Represents the path of a topic for the Ditto Protocol.

    A TopicPath complies with the scheme <namespace>/<id>/<group>/<channel>/<criterion>/<action>
    for example org.eclipse.ditto/myThing/things/twin/commands/modify

    • Method Detail

      • newBuilder

        static TopicPathBuilder newBuilder​(org.eclipse.ditto.model.things.ThingId thingId)
        Returns a mutable builder to create immutable TopicPath instances for a given thingId.
        Parameters:
        thingId - the identifier of the Thing.
        Returns:
        the builder.
        Throws:
        NullPointerException - if thingId is null.
      • newBuilder

        static TopicPathBuilder newBuilder​(org.eclipse.ditto.model.policies.PolicyId policyId)
        Returns a mutable builder to create immutable TopicPath instances for a given policyId.
        Parameters:
        policyId - the identifier of the Policy.
        Returns:
        the builder.
        Throws:
        NullPointerException - if policyId is null.
      • fromNamespace

        static TopicPathBuilder fromNamespace​(String namespace)
        Returns a mutable builder to create immutable TopicPath instances for a given namespace.
        Parameters:
        namespace - the namespace.
        Returns:
        the builder.
        Throws:
        NullPointerException - if namespace is null.
      • getNamespace

        String getNamespace()
        Returns the namespace part of this TopicPath.
        Returns:
        the namespace.
      • getGroup

        TopicPath.Group getGroup()
        Returns the group part of this TopicPath.
        Returns:
        the group.
      • getChannel

        TopicPath.Channel getChannel()
        Returns the channel part of this TopicPath.
        Returns:
        the channel.
      • getCriterion

        TopicPath.Criterion getCriterion()
        Returns the criterion part of this TopicPath.
        Returns:
        the criterion.
      • getSubject

        Optional<String> getSubject()
        Returns an Optional for a subject part of this TopicPath.
        Returns:
        the subject.
      • getId

        String getId()
        Returns the id part of this TopicPath.
        Returns:
        the id.
      • getPath

        String getPath()
        Returns the path of this TopicPath.
        Returns:
        the path.
      • isWildcardTopic

        default boolean isWildcardTopic()