Package org.openhab.core.util
Class UIDUtils
java.lang.Object
org.openhab.core.util.UIDUtils
Utilities for UIDs.
- Author:
- Markus Rathgeb - Initial contribution
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
UIDUtils
public UIDUtils()
-
-
Method Details
-
encode
Encodes a given string to a UID using only allowed characters.The generated UID can be given to the
decode(String)
function and it will result into the given value.- Parameters:
value
- the string that should be encoded to a valid UID- Returns:
- a string that if a valid UID (with respect to the allowed characters)
-
decode
Decodes a UID that has been generated by theencode(String)
function.This function should only be used for UIDs generated by the
encode(String)
function. For every other UID the result is rather useless or could result into anIllegalArgumentException
.- Parameters:
value
- the UID to decode- Returns:
- the decoded UID string
- Throws:
IllegalArgumentException
- if the given UID is not a valid encoded input
-