Class HexUtils
- java.lang.Object
-
- io.servicetalk.opentracing.internal.HexUtils
-
public final class HexUtils extends java.lang.ObjectUtilities for hex strings.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringhexBytesOfLong(long v)Builds an hexStringthat represents the providedlongvalue.static longlongOfHexBytes(java.lang.String str, int offset)Retrieves thelongvalue represented by the provided hexString.static <T extends java.lang.CharSequence>
TvalidateHexBytes(T str)Checks that the providedCharSequenceis a valid hexCharSequence, throwing anIllegalArgumentExceptionif it is not.
-
-
-
Method Detail
-
validateHexBytes
public static <T extends java.lang.CharSequence> T validateHexBytes(T str)
Checks that the providedCharSequenceis a valid hexCharSequence, throwing anIllegalArgumentExceptionif it is not.- Type Parameters:
T- The type ofCharSequenceto validate.- Parameters:
str- theCharSequenceto check.- Returns:
- the provided
CharSequenceunchanged.
-
longOfHexBytes
public static long longOfHexBytes(java.lang.String str, int offset)Retrieves thelongvalue represented by the provided hexString. ThrowsStringIndexOutOfBoundsExceptionif offset is invalid.- Parameters:
str- an hexString.offset- The index to start withinstrto start the conversion.- Returns:
- the
longvalue.
-
hexBytesOfLong
public static java.lang.String hexBytesOfLong(long v)
Builds an hexStringthat represents the providedlongvalue.- Parameters:
v- thelongvalue.- Returns:
- an hex
String.
-
-