diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2015-03-29 22:54:01 +0200 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2015-03-29 22:54:01 +0200 |
commit | 50650c4970c868134f75f4afe03738f67966bfe3 (patch) | |
tree | d6a403a455e8d43a1faa6bbd98a52a13fae7d415 /kamon-core/src/main | |
parent | ef43abf9b54ba70783eb645f020b87c18bb58cb4 (diff) | |
download | Kamon-50650c4970c868134f75f4afe03738f67966bfe3.tar.gz Kamon-50650c4970c868134f75f4afe03738f67966bfe3.tar.bz2 Kamon-50650c4970c868134f75f4afe03738f67966bfe3.zip |
+ core: simple util to transform java maps to scala maps when creating tags.
Diffstat (limited to 'kamon-core/src/main')
-rw-r--r-- | kamon-core/src/main/scala/kamon/util/JavaTags.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kamon-core/src/main/scala/kamon/util/JavaTags.scala b/kamon-core/src/main/scala/kamon/util/JavaTags.scala new file mode 100644 index 00000000..90bece5c --- /dev/null +++ b/kamon-core/src/main/scala/kamon/util/JavaTags.scala @@ -0,0 +1,14 @@ +package kamon.util + +object JavaTags { + + /** + * Helper method to transform Java maps into Scala maps. Typically this will be used as a static import from + * Java code that wants to use tags, as tags are defined as scala.collection.mutable.Map[String, String] and + * creating them directly from Java is quite verbose. + */ + def tagsFromMap(tags: java.util.Map[String, String]): Map[String, String] = { + import scala.collection.JavaConversions._ + tags.toMap + } +} |