public final class UTF8String extends Object implements scala.math.Ordered<UTF8String>, scala.Serializable
A String encoded in UTF-8 as an Array[Byte], which can be used for comparison, search, see http://en.wikipedia.org/wiki/UTF-8 for details.
Note: This is not designed for general use cases, should not be used outside SQL.
| Constructor and Description |
|---|
UTF8String() |
| Modifier and Type | Method and Description |
|---|---|
static UTF8String |
apply(byte[] bytes)
Create a UTF-8 String from Array[Byte], which should be encoded in UTF-8
|
static UTF8String |
apply(String s)
Create a UTF-8 String from String
|
static int[] |
bytesOfCodePointInUTF8() |
UTF8String |
clone() |
int |
compare(UTF8String other) |
int |
compareTo(UTF8String other) |
boolean |
contains(UTF8String sub) |
boolean |
endsWith(UTF8String suffix) |
boolean |
equals(Object other) |
byte[] |
getBytes() |
int |
hashCode() |
int |
length()
Return the number of code points in it.
|
UTF8String |
set(byte[] bytes)
Update the UTF8String with Array[Byte], which should be encoded in UTF-8
|
UTF8String |
set(String str)
Update the UTF8String with String.
|
UTF8String |
slice(int start,
int until)
Return a substring of this,
|
boolean |
startsWith(UTF8String prefix) |
UTF8String |
toLowerCase() |
String |
toString() |
UTF8String |
toUpperCase() |
public static int[] bytesOfCodePointInUTF8()
public static UTF8String apply(String s)
s - (undocumented)public static UTF8String apply(byte[] bytes)
bytes - (undocumented)public UTF8String set(String str)
str - (undocumented)public UTF8String set(byte[] bytes)
bytes - (undocumented)public int length()
This is only used by Substring() when start is negative.
public byte[] getBytes()
public UTF8String slice(int start, int until)
start - the position of first code pointuntil - the position after last code pointpublic boolean contains(UTF8String sub)
public boolean startsWith(UTF8String prefix)
public boolean endsWith(UTF8String suffix)
public UTF8String toUpperCase()
public UTF8String toLowerCase()
public String toString()
toString in class Objectpublic UTF8String clone()
clone in class Objectpublic int compare(UTF8String other)
compare in interface scala.math.Ordered<UTF8String>public int compareTo(UTF8String other)
compareTo in interface Comparable<UTF8String>compareTo in interface scala.math.Ordered<UTF8String>public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Object