class PositionBasedTransformer implements Transformer {

    @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;
    }

    public  PositionBasedTransformer(Map<String, Category> mappings);

}