Package org.somda.sdc.biceps.provider
Class HandleGenerator
- java.lang.Object
-
- org.somda.sdc.biceps.provider.HandleGenerator
-
public class HandleGenerator extends Object
Utility to create handles.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HandleGeneratorcreate(String prefix)Creates instance that generates handles with a fixed prefix.static StringcreateGloballyUnique()Creates a handle that is globally unique.static StringcreateOne(String prefix)Static function to create one handle with a given prefix.Stringnext()Creates the next handle with the prefix given during construction.
-
-
-
Method Detail
-
create
public static HandleGenerator create(String prefix)
Creates instance that generates handles with a fixed prefix.- Parameters:
prefix- the prefix to set for all generated handles.- Returns:
- a handle generator instance.
-
createOne
public static String createOne(String prefix)
Static function to create one handle with a given prefix.- Parameters:
prefix- the prefix to set for the call.- Returns:
- handle name in the format: prefix + non-negative integer.
-
createGloballyUnique
public static String createGloballyUnique()
Creates a handle that is globally unique.- Returns:
- a UUID in hex format.
-
next
public String next()
Creates the next handle with the prefix given during construction.- Returns:
- handle name in the format: prefix + non-negative integer.
-
-