Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods to TopicPath to make its evaluation easier #1043

Closed
jufickel-b opened this issue Apr 29, 2021 · 0 comments · Fixed by #1048
Closed

Add methods to TopicPath to make its evaluation easier #1043

jufickel-b opened this issue Apr 29, 2021 · 0 comments · Fixed by #1048
Assignees
Milestone

Comments

@jufickel-b
Copy link

There are situations where a TopicPath of a Ditto Protocol Message should be evaluated.
For example, if one wants to know whether the group is "Things" or the its action is "create", the appropriate getter methods have to be called.
The result of those getters is sometimes an Optional which puts another indirection to the evaluation.

To make evaluation of a TopicPath easier, methods should be added which return boolean like for example

public boolean isGroup(final Group expectedGroup) { ... }
@jufickel-b jufickel-b self-assigned this Apr 29, 2021
@thjaeckle thjaeckle added this to the 2.0.0 milestone May 4, 2021
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
…PathBuilder` to package level. Added a unit test.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
…ments of `ImmutableTopicPath`.

* `ImmutableTopicPathBuilder` is now a private nested class of `ImmutableTopicPath` to be able to refer to to its instance field in constructor.
* An instance of `ImmutableTopicPath` can now only be obtained via builder. Thus removed static factory methods.
* Moved parsing of TopicPath string representation from `ProtocolFactory` to `ImmutableTopicPath` to make use of the nested builder.
* Reworked parsing of `TopicPath` from string to provide meaningful context in case of errors.
* Adjusted some Javadoc comments to reflect the code.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
…icPath`.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
….` methods of `TopicPath`.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
…h#getPath()` and added a unit test that covers an empty namespace part.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
…to Protocol messages are always required to have a topic. Thus an empty topic path implementation did not make sense.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
…ges to add `@Nullable` annotations.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
`HeaderTranslator#fromExternalHeaders(Map)` might return an unmodifiable Map.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
* Removed unused methods.
* Re-ordered methods according to the Stepdown Rule.
* Moved method `getEventTopicPathBuilderFor` to `AbstractThingAdapter` as it is only used by sub-classes thereof.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
…ckages to add `@Nullable` annotations.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
…er branch.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
jufickel-b pushed a commit to bosch-io/ditto that referenced this issue May 4, 2021
Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants