Class IdentifiersGenerator


  • public class IdentifiersGenerator
    extends 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.
    • Constructor Detail

      • IdentifiersGenerator

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

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

      • addGeneratedId

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

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

        @NotNull
        public 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 String getPrefix()
        Returns:
        generator's prefix