Package org.apache.lucene.util
Class ToStringUtils
- java.lang.Object
-
- org.apache.lucene.util.ToStringUtils
-
public final class ToStringUtils extends Object
Helper methods to ease implementingObject.toString()
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
byteArray(StringBuilder buffer, byte[] bytes)
static String
bytesRefToString(byte[] b)
static String
bytesRefToString(BytesRef b)
Builds a String with both textual representation of theBytesRef
data and the bytes hex values.static String
bytesRefToString(BytesRefBuilder b)
static String
longHex(long x)
UnlikeLong.toHexString(long)
returns a String with a "0x" prefix and all the leading zeros.
-
-
-
Method Detail
-
byteArray
public static void byteArray(StringBuilder buffer, byte[] bytes)
-
longHex
public static String longHex(long x)
UnlikeLong.toHexString(long)
returns a String with a "0x" prefix and all the leading zeros.
-
bytesRefToString
public static String bytesRefToString(BytesRef b)
Builds a String with both textual representation of theBytesRef
data and the bytes hex values. For example:"hello [68 65 6c 6c 6f]"
. If the content is not a valid UTF-8 sequence, only the bytes hex values are returned, as perBytesRef.toString()
.
-
bytesRefToString
public static String bytesRefToString(BytesRefBuilder b)
-
bytesRefToString
public static String bytesRefToString(byte[] b)
-
-