Class MigrationRegistry

java.lang.Object
ru.cg.webbpm.studio.core.api.migrations.MigrationRegistry

public class MigrationRegistry extends Object
Stores converters by version and object class. Used in studio and packages' conversion modules.
Author:
krylov
  • Constructor Details

    • MigrationRegistry

      public MigrationRegistry()
  • Method Details

    • put

      public <T> void put(Version version, Class<T> objectClass, Converter<T> converter)
      Put a converter
      Type Parameters:
      T - converter object type
      Parameters:
      version - converter version
      objectClass - class that converter converts
      converter - the converter
    • get

      public <T> List<Converter<T>> get(Version startExclusive, Version endInclusive, Class<T> objectClass)
      Get all converters for specified version range and object type
      Type Parameters:
      T - object type
      Parameters:
      startExclusive - min version, exclusive
      endInclusive - max version, inclusive
      objectClass - object type
      Returns:
      list of converters
    • get

      public <T> List<Converter<T>> get(Version version, Class<T> objectClass)
      Returns converters for specified version and object class
      Parameters:
      version - the version
      objectClass - the object class
      Returns:
      converters list
    • versionRange

      public SortedSet<Version> versionRange(Version start, Version end)
      Returns all versions in specified range
      Parameters:
      start - start inclusive
      end - end inclusive
      Returns:
      sorted set of all versions in the range
    • getConverterMap

      public NavigableMap<Version,org.springframework.util.MultiValueMap<Class<?>,Converter<?>>> getConverterMap()