Package jetbrains.buildServer.util
Class IdentifiersGenerator
- java.lang.Object
-
- jetbrains.buildServer.util.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.
-
-
Constructor Summary
Constructors Constructor Description IdentifiersGenerator(java.lang.String prefix)
IdentifiersGenerator(java.lang.String prefix, boolean acceptPrefixAsId)
-
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 prefixjava.lang.String
showNextId()
-
-
-
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 tonewId()
UnlikenewId()
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
-
-