Package com.wavefront.agent
Class Utils
- java.lang.Object
-
- com.wavefront.agent.Utils
-
public abstract class Utils extends Object
A placeholder class for miscellaneous utility methods.- Author:
- [email protected]
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
addHyphensToUuid(String uuid)
Requires an input uuid string Encoded as 32 hex characters.static String
convertToUuidString(String id)
Method converts a string Id toUUID
.static <T> Supplier<T>
lazySupplier(Supplier<T> supplier)
A lazy initialization wrapper forSupplier
-
-
-
Method Detail
-
lazySupplier
public static <T> Supplier<T> lazySupplier(Supplier<T> supplier)
A lazy initialization wrapper forSupplier
- Parameters:
supplier
-Supplier
to lazy-initialize- Returns:
- lazy wrapped supplier
-
addHyphensToUuid
public static String addHyphensToUuid(String uuid)
Requires an input uuid string Encoded as 32 hex characters. For examplecced093a76eea418ffdc9bb9a6453df3
- Parameters:
uuid
- string encoded as 32 hex characters.- Returns:
- uuid string encoded in 8-4-4-4-12 (rfc4122) format.
-
convertToUuidString
@Nullable public static String convertToUuidString(@Nullable String id)
Method converts a string Id toUUID
. This Method specifically converts id's with less than 32 digit hex characters into UUID format (See RFC 4122: A Universally Unique IDentifier (UUID) URN Namespace) by left padding id with Zeroes and adding hyphens. It assumes that if the input id contains hyphens it is already an UUID. Please don't use this method to validate/guarantee your id as an UUID.- Parameters:
id
- a string encoded in hex characters.- Returns:
- a UUID string.
-
-