Class IdentifiersGenerator


  • public class IdentifiersGenerator
    extends java.lang.Object
    The class implements a generator and registry of IDs for a single type of build config settings. Where the type is specified by the IDs prefix.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addGeneratedId​(java.lang.String id)
      Remembers id which was already generated somehow (either by this generator, or not).
      java.lang.String getPrefix()  
      java.lang.String newId()
      Creates new id with corresponding prefix
      java.lang.String showNextId()
      Returns an id that would be generated on next call to newId() Unlike newId() doesn't increase internal counter so can return the same ID on subsequent calls
      • Methods inherited from class java.lang.Object

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

      • IdentifiersGenerator

        public IdentifiersGenerator​(@NotNull
                                    java.lang.String prefix,
                                    boolean acceptPrefixAsId)
      • IdentifiersGenerator

        public IdentifiersGenerator​(@NotNull
                                    java.lang.String prefix)
    • Method Detail

      • addGeneratedId

        public void addGeneratedId​(@NotNull
                                   java.lang.String id)
        Remembers id which was already generated somehow (either by this generator, or not).
        Parameters:
        id - generated id
      • newId

        @NotNull
        public java.lang.String newId()
        Creates new id with corresponding prefix
        Returns:
        new id
      • showNextId

        @NotNull
        public java.lang.String showNextId()
        Returns an id that would be generated on next call to newId() Unlike newId() doesn't increase internal counter so can return the same ID on subsequent calls
        Returns:
        new id
      • getPrefix

        @NotNull
        public java.lang.String getPrefix()
        Returns:
        generator's prefix