public interface StringKeyConvertor<K>
String
representation.Modifier and Type | Interface and Description |
---|---|
static class |
StringKeyConvertor.StringKey |
static class |
StringKeyConvertor.ULongKey |
static class |
StringKeyConvertor.UUIDKey |
Modifier and Type | Method and Description |
---|---|
K |
fromString(String key)
Returns native representation of the key from String representation
|
default K |
fromStringSafe(String key)
Exception-free variant of
fromString(java.lang.String) method. |
default String |
keyToString(K key)
Returns String representation of the key from native representation
|
K |
yieldNewUniqueKey()
Returns a new unique primary key for the storage that
this
StringKeyConvertor belongs to. |
default String keyToString(K key)
key
- IllegalArgumentException
- if the string format is not recognizedNullPointerException
- if the parameter is null
K yieldNewUniqueKey()
StringKeyConvertor
belongs to. The uniqueness
needs to be guaranteed by e.g. using database sequences or
using a random value that is proved sufficiently improbable
to be repeated.K fromString(String key)
key
- IllegalArgumentException
- if the string format is not recognizedNullPointerException
- if the parameter is null
default K fromStringSafe(String key)
fromString(java.lang.String)
method.
Returns native representation of the key from String representation,
or null
if the key
is either null
or invalid.key
- Copyright © 2021 JBoss by Red Hat. All rights reserved.