public class VisitorId extends Object
| Constructor and Description |
|---|
VisitorId() |
| Modifier and Type | Method and Description |
|---|---|
static VisitorId |
fromHash(long hash)
Creates always the same visitor id for the given input.
|
static VisitorId |
random()
Static factory to generate a random visitor id.
|
String |
toString() |
public static VisitorId random()
Please consider creating a fixed id for each visitor by getting a hash code from e.g. the username and using fromHash(long)
public static VisitorId fromHash(long hash)
You can use e.g. Object.hashCode() to generate a hash code for an object, e.g. a username string as input.
hash - A number (e.g. a hash code) to create the visitor id fromCopyright © 2022 drjekyll.org. All rights reserved.