Class IdMappingUtil


  • public final class IdMappingUtil
    extends java.lang.Object
    A utility class for generating and parsing id mappings held by ReplaceIdGenerators.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​com.google.common.collect.BiMap<java.lang.String,​java.lang.String>> parseSerializedIdMappings​(java.lang.String idMappings)
      The expected format looks like this:
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • parseSerializedIdMappings

        public static java.util.Map<java.lang.String,​com.google.common.collect.BiMap<java.lang.String,​java.lang.String>> parseSerializedIdMappings​(java.lang.String idMappings)
        The expected format looks like this:

        [generatorName1] someId1:someFile:theLine:theColumn ...

        [[generatorName2] someId2:someFile:theLine:theColumn] ...

        The returned data is grouped by generator name (the map key). The inner map provides mappings from id to content (file, line and column info). In a glimpse, the structure is Map<generator name, BiMap<id, value>>.

        @throws IllegalArgumentException malformed input where there it 1) has duplicate generator name, or 2) the line has no ':' for id and its content.