Class UTF8String
java.lang.Object
se.kuseman.payloadbuilder.api.execution.UTF8String
- All Implemented Interfaces:
Comparable<UTF8String>,ValueVector
A bytes reference used for data types that supports operations directly on under laying byte structures like Strings etc. NOTE!
ValueVector is implemented here to let a single string become
a literal value vector of it self to avoid creating a literal-
Nested Class Summary
Nested classes/interfaces inherited from interface se.kuseman.payloadbuilder.api.execution.ValueVector
ValueVector.LiteralValueVector -
Field Summary
FieldsFields inherited from interface se.kuseman.payloadbuilder.api.execution.ValueVector
EMPTY_VECTOR_BY_TYPE, FALSE_VECTORS, ONE_SIZE_NULL_VECTOR_BY_TYPE, TRUE_VECTORS -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(UTF8String that) Compare this reference to another bytes referencestatic UTF8Stringconcat(List<UTF8String> strings) Concats provided string with a comma delimiterstatic UTF8Stringconcat(UTF8String delimeter, List<UTF8String> strings) Concats provided string with a delimiterbooleanstatic UTF8Stringfrom(boolean value) static UTF8StringCreates a string from provided object.static UTF8StringintReturn the byte length of this instance.byte[]getBytes()Return a copy of the underlying utf8 bytes for this stringvoidgetBytes(byte[] destination) Return the bytes of this instance into destination byte array.getString(int row) Get string at provided row.inthashCode()booleanReturns true if this instance has aStringinstance.booleanisNull(int row) Return if value at provided row is nullstatic UTF8Stringlatin(byte[] bytes) static UTF8Stringlatin(byte[] bytes, int offset, int length) Create a utf8 string from latin encoded bytes.intsize()Return size of vectortoString()Return a string representation of this instancetype()Return type of vector valuesstatic UTF8Stringutf8(byte[] bytes) static UTF8Stringutf8(byte[] bytes, int offset, int length) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface se.kuseman.payloadbuilder.api.execution.ValueVector
getAny, getArray, getBoolean, getCardinality, getDateTime, getDateTimeOffset, getDecimal, getDouble, getFloat, getInt, getLong, getObject, getPredicateBoolean, getTable, toCsv, toCsv, valueAsObject, valueAsString
-
Field Details
-
EMPTY
-
COMMA
-
-
Method Details
-
getBytes
public byte[] getBytes()Return a copy of the underlying utf8 bytes for this string -
getBytes
public void getBytes(byte[] destination) Return the bytes of this instance into destination byte array. Caller is responsible for correct length -
size
public int size()Description copied from interface:ValueVectorReturn size of vector- Specified by:
sizein interfaceValueVector
-
type
Description copied from interface:ValueVectorReturn type of vector values- Specified by:
typein interfaceValueVector
-
isNull
public boolean isNull(int row) Description copied from interface:ValueVectorReturn if value at provided row is null- Specified by:
isNullin interfaceValueVector
-
getString
Description copied from interface:ValueVectorGet string at provided row.- Specified by:
getStringin interfaceValueVector
-
compareTo
Compare this reference to another bytes reference- Specified by:
compareToin interfaceComparable<UTF8String>
-
hashCode
public int hashCode() -
equals
-
hasString
public boolean hasString()Returns true if this instance has aStringinstance. -
getByteLength
public int getByteLength()Return the byte length of this instance. -
toString
Return a string representation of this instance -
concat
Concats provided string with a comma delimiter -
concat
Concats provided string with a delimiter -
from
Creates a string from provided object. Will fallback to toString if no known type is found -
from
-
from
-
utf8
-
utf8
-
latin
-
latin
Create a utf8 string from latin encoded bytes. NOTE! Recommended usage is utf8 since this method allocates some when converting bytes.
-