Class UUIDConverter
java.lang.Object
org.springframework.integration.util.UUIDConverter
Utility to help generate UUID instances from generic objects.
- Author:
- Dave Syer, Gary Russell, Christian Tzolov, Artem Bilan
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.since 6.0.8 as it is not used internally by the UUIDConverter. -
Constructor Summary
-
Method Summary
-
Field Details
-
DEFAULT_CHARSET
Deprecated.since 6.0.8 as it is not used internally by the UUIDConverter. The internal implementation relies onStandardCharsets.UTF_8
instead.- See Also:
-
-
Constructor Details
-
UUIDConverter
public UUIDConverter()
-
-
Method Details
-
convert
Convert the input to a UUID using the convenience methodgetUUID(Object)
. -
getUUID
Convenient utility to convert an object to a UUID. If the input is- null: returns null
- a UUID: returns the input unchanged
- a String formatted as a UUID: returns the result of
UUID.fromString(String)
- any other String: returns
UUID.nameUUIDFromBytes(byte[])
with bytes generated from the input - a primitive or primitive wrapper: converts to a String ans then uses the previous conversion method
- Serializable: returns the
UUID.nameUUIDFromBytes(byte[])
with the serialized bytes of the input
- Parameters:
input
- an Object- Returns:
- a UUID constructed from the input
-