@ParametersAreNonnullByDefault public class LongIdProvider extends AbstractIdProvider
IdProvider
that provides Id
with a long representation.LongId
Modifier and Type | Method and Description |
---|---|
Id |
fromHexString(String hexValue)
Creates a new
Id from an hexadecimal representation. |
Id |
fromLong(long value)
Creates a new
Id from a long representation. |
Id |
generate()
Generates a new instance of an
Id initialized with a random value. |
Id |
generate(String baseValue)
Generates a new instance of an
Id from a baseValue . |
static IdProvider |
getInstance()
Returns the instance of this class.
|
hasher
@Nonnull public static IdProvider getInstance()
@Nonnull public Id fromLong(long value)
IdProvider
Id
from a long representation.value
- the long representation of the new identifierId
Id.toLong()
@Nonnull public Id fromHexString(String hexValue)
IdProvider
Id
from an hexadecimal representation.hexValue
- the hexadecimal representation of the new identifierId
Id.toHexString()
@Nonnull public Id generate()
IdProvider
Id
initialized with a random value.Id
@Nonnull public Id generate(String baseValue)
IdProvider
Id
from a baseValue
.
Several calls to this method with the same baseValue
should return the same identifier.
baseValue
- the base value of the identifierId
Copyright © 2013–2019 Atlanmod. All rights reserved.