Skip to content

Commit

Permalink
Issue #106: review: add @SInCE annotation, format code, remove unnece…
Browse files Browse the repository at this point in the history
…ssary 'public' keyword

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
  • Loading branch information
yufei-cai committed Nov 26, 2021
1 parent 96ed087 commit 1683e8b
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@

/**
* A function to extract information from the topic path and enrich the ditto headers with them.
*
* <p>
* A set of available extractors, e.g. for live-channel and entityId, which can be used for
* {@link #injectHeaders(DittoHeaders, TopicPath, Extractor[])} is provided by inner class {@link Extractor}.
*
* @since 2.3.0
*/
public final class HeadersFromTopicPath {

private HeadersFromTopicPath() {
}

/**
* Injects new headers
* Injects new headers
*
* @param dittoHeaders the headers where the additional headers shall be injected into.
* @param topicPath where the headers will be extracted from.
Expand Down Expand Up @@ -70,7 +72,7 @@ public interface Extractor extends Function<TopicPath, Optional<Map.Entry<String
* @param topicPath the topic path to extract information from.
* @return header KV containing the extra information from topic path.
*/
public static Optional<Map.Entry<String, String>> liveChannelExtractor(final TopicPath topicPath) {
static Optional<Map.Entry<String, String>> liveChannelExtractor(final TopicPath topicPath) {
if (topicPath.isChannel(TopicPath.Channel.LIVE)) {
final String key = DittoHeaderDefinition.CHANNEL.getKey();
final String value = TopicPath.Channel.LIVE.getName();
Expand All @@ -84,7 +86,7 @@ public static Optional<Map.Entry<String, String>> liveChannelExtractor(final Top
/**
* Extracts the entityId from the Topic-Path if none of the pieces is a placeholder ('_').
*
* @param topicPath the topic path to extract information from.
* @param topicPath the topic path to extract information from.
* @return header KV containing the extra information from topic path.
*/
static Optional<Map.Entry<String, String>> entityIdExtractor(final TopicPath topicPath) {
Expand Down

0 comments on commit 1683e8b

Please sign in to comment.