textbender.g.util
Class UUIDStringifier

java.lang.Object
  extended by UUIDStringifier

@ThreadRestricted
public final class UUIDStringifier
extends Object

UUID-to-string converter.


Constructor Summary
UUIDStringifier()
           
 
Method Summary
 String toBase64Name(UUID uuid)
          Converts the UUID to a Base64 string, valid as an XML 'name'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UUIDStringifier

public UUIDStringifier()
Method Detail

toBase64Name

public String toBase64Name(UUID uuid)
Converts the UUID to a Base64 string, valid as an XML 'name'. The encoding is the "URL and filename safe" variation of Base64 described in Section 4 of RFC3548, with two alterations. First, if the leading character is not valid for an XML name, then an underscore '_' is prefixed to the result string. Second, any trailing pad characters '=' are deleted. The result is either a string of 22 characters, in the pattern:
[A-Za-z_][A-Za-z_0-9-]{21}

Or 23 characters, in the pattern:

_[0-9-][A-Za-z_0-9-]{21}