org.apache.storm.rocketmq.common.selector

## Class FieldNameBasedTopicSelector

- java.lang.Object
- - org.apache.storm.rocketmq.common.selector.FieldNameBasedTopicSelector

- All Implemented Interfaces:
    Serializable, TopicSelector

      public class FieldNameBasedTopicSelector
      extends Object
      implements TopicSelector

  Uses field name to select topic and tag name from tuple.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FieldNameBasedTopicSelector(String topicFieldName, String defaultTopicName, String tagFieldName, String defaultTagName)` FieldNameBasedTopicSelector Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getTag(ITuple tuple)`
    `String` | `getTopic(ITuple tuple)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FieldNameBasedTopicSelector

          public FieldNameBasedTopicSelector(String topicFieldName,
                                             String defaultTopicName,
                                             String tagFieldName,
                                             String defaultTagName)

      FieldNameBasedTopicSelector Constructor.

      Parameters:
        `topicFieldName` - field name used for selecting topic
        `defaultTopicName` - default field name used for selecting topic
        `tagFieldName` - field name used for selecting tag
        `defaultTagName` - default field name used for selecting tag

  - ### Method Detail

    - #### getTopic

          public String getTopic(ITuple tuple)

      Specified by:
        `getTopic` in interface `TopicSelector`

    - #### getTag

          public String getTag(ITuple tuple)

      Specified by:
        `getTag` in interface `TopicSelector`

Copyright © 2019 The Apache Software Foundation. All rights reserved.