Package jetbrains.buildServer.util
Class IdentifiersGenerator
- java.lang.Object
-
- jetbrains.buildServer.util.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 Summary
Constructors Constructor Description IdentifiersGenerator(String prefix)
IdentifiersGenerator(String prefix, boolean acceptPrefixAsId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGeneratedId(String id)
Remembers id which was already generated somehow (either by this generator, or not).String
getPrefix()
String
newId()
Creates new id with corresponding prefixString
showNextId()
-
-
-
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 tonewId()
UnlikenewId()
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
-
-