Package org.keycloak.models.map.common
Interface StringKeyConverter<K>
- 
- All Known Implementing Classes:
- StringKeyConverter.StringKey,- StringKeyConverter.ULongKey,- StringKeyConverter.UUIDKey
 
 public interface StringKeyConverter<K>Converts given storage key from and toStringrepresentation.- Author:
- hmlnarik
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classStringKeyConverter.StringKeystatic classStringKeyConverter.ULongKeystatic classStringKeyConverter.UUIDKey
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description KfromString(String key)Returns native representation of the key from String representationdefault KfromStringSafe(String key)Exception-free variant offromString(java.lang.String)method.default StringkeyToString(K key)Returns String representation of the key from native representationKyieldNewUniqueKey()Returns a new unique primary key for the storage that thisStringKeyConverterbelongs to.
 
- 
- 
- 
Method Detail- 
keyToStringdefault String keyToString(K key) Returns String representation of the key from native representation- Parameters:
- key-
- Returns:
- See above
- Throws:
- IllegalArgumentException- if the string format is not recognized
- NullPointerException- if the parameter is- null
 
 - 
yieldNewUniqueKeyK yieldNewUniqueKey() Returns a new unique primary key for the storage that thisStringKeyConverterbelongs 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.- Returns:
 
 - 
fromStringK fromString(String key) Returns native representation of the key from String representation- Parameters:
- key-
- Returns:
- See above
- Throws:
- IllegalArgumentException- if the string format is not recognized
- NullPointerException- if the parameter is- null
 
 - 
fromStringSafedefault K fromStringSafe(String key) Exception-free variant offromString(java.lang.String)method. Returns native representation of the key from String representation, ornullif thekeyis eithernullor invalid.- Parameters:
- key-
- Returns:
- See above
 
 
- 
 
-