test_class.file: metrics-influxdb/src/test/java/com/izettle/metrics/influxdb/tags/PositionBasedTransformerTest.java
test_class.identifier: PositionBasedTransformerTest
test_case.body: @Test
      public void shouldIgnoreIncorrectPosition() {
          Map<String, PositionBasedTransformer.Category> mappings = new HashMap<String, PositionBasedTransformer.Category>();
          mappings.put("incorrectTag", new PositionBasedTransformer.Category(42, ".*"));
          PositionBasedTransformer transformer = new PositionBasedTransformer(mappings);
          assertThat(transformer.getTags("com.izettle.metrics.influxdb.tags.PositionBasedTransformer.count")).isEmpty();
      }
test_case.class_method_signature: PositionBasedTransformerTest.shouldIgnoreIncorrectPosition()
test_case.full_signature: @Test public void shouldIgnoreIncorrectPosition()
test_case.identifier: shouldIgnoreIncorrectPosition
test_case.invocations: put isEmpty assertThat getTags
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldIgnoreIncorrectPosition()
focal_class.declarator: SEPARATOR = "\\."
focal_class.modifier: private static final
focal_class.original_string: private static final String SEPARATOR = "\\.";
focal_class.type: String
focal_class.var_name: SEPARATOR
focal_class.declarator: mappings
focal_class.modifier: private final
focal_class.original_string: private final Map<String, Category> mappings;
focal_class.type: Map<String, Category>
focal_class.var_name: mappings
focal_class.file: metrics-influxdb/src/main/java/com/izettle/metrics/influxdb/tags/PositionBasedTransformer.java
focal_class.identifier: PositionBasedTransformer
focal_class.interfaces: implements Transformer
focal_class.class_method_signature: PositionBasedTransformer.PositionBasedTransformer(Map<String, Category> mappings)
focal_class.full_signature: public  PositionBasedTransformer(Map<String, Category> mappings)
focal_class.identifier: PositionBasedTransformer
focal_class.modifiers: public
focal_class.parameters: (Map<String, Category> mappings)
focal_class.signature:  PositionBasedTransformer(Map<String, Category> mappings)
focal_class.class_method_signature: PositionBasedTransformer.getTags(String metricsName)
focal_class.full_signature: @Override public Map<String, String> getTags(String metricsName)
focal_class.identifier: getTags
focal_class.modifiers: @Override public
focal_class.parameters: (String metricsName)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> getTags(String metricsName)
focal_method.body: @Override
      public Map<String, String> getTags(String metricsName) {
          String[] parts = metricsName.split(SEPARATOR);
          Map<String, String> tags = new HashMap<String, String>();
  
          for (Map.Entry<String, Category> entry : mappings.entrySet()) {
              final Pattern pattern = entry.getValue().getMapping();
              final int position = entry.getValue().position;
  
              if ((parts.length > position) && pattern.matcher(metricsName).matches()) {
                  tags.put(entry.getKey(), parts[position]);
              }
          }
  
          return tags;
      }
focal_method.class_method_signature: PositionBasedTransformer.getTags(String metricsName)
focal_method.full_signature: @Override public Map<String, String> getTags(String metricsName)
focal_method.identifier: getTags
focal_method.invocations: split entrySet getMapping getValue getValue matches matcher put getKey
focal_method.modifiers: @Override public
focal_method.parameters: (String metricsName)
focal_method.return: Map<String, String>
focal_method.signature: Map<String, String> getTags(String metricsName)