public class IdGenerator extends Object
Constructor and Description |
---|
IdGenerator() |
Modifier and Type | Method and Description |
---|---|
static long |
createId()
Generates a numeric ID as xA+B.
|
static int |
extractPrefix(long id)
Returns the id prefix for the given id.
|
static int |
getMultiplier()
Returns the multiplier for an id, needed to validate id values
|
static int |
getPrefix()
Returns the id prefix - needed for testing.
|
static String |
getString(long id)
Converts ID value to String as A.B.
|
static void |
recycle()
Recycles the generator.
|
static void |
setPrefix(int value)
Each entity living in a separate process must have a different prefix
value.
|
public static long createId()
public static void setPrefix(int value)
public static int getPrefix()
public static String getString(long id)
public static int getMultiplier()
public static int extractPrefix(long id)
public static void recycle()
Copyright © 2019 Power TAC. All rights reserved.