Package com.yahoo.jrt
Class StringValue
java.lang.Object
com.yahoo.jrt.Value
com.yahoo.jrt.StringValue
String value. The internal string representation is UTF-8 encoded
bytes. This means that creating an object of this class as well as
extracting the value contained with the
asString
method will incur a string conversion overhead.-
Field Summary
Fields inherited from class com.yahoo.jrt.Value
DATA, DATA_ARRAY, DOUBLE, DOUBLE_ARRAY, FLOAT, FLOAT_ARRAY, INT16, INT16_ARRAY, INT32, INT32_ARRAY, INT64, INT64_ARRAY, INT8, INT8_ARRAY, STRING, STRING_ARRAY
-
Constructor Summary
ConstructorDescriptionStringValue
(com.yahoo.text.Utf8Array value) StringValue
(com.yahoo.text.Utf8String value) StringValue
(String value) Create from a Java-type value -
Method Summary
Modifier and TypeMethodDescriptionasString()
Interpret this value as aStringValue
and return the contents as an appropriate Java typecom.yahoo.text.Utf8Array
Interpret this value as aStringValue
and return the contents as an appropriate Java typeint
count()
Obtain the number of entries stored in this value.toString()
Force a proper toStringbyte
type()
Obtain the type identifier for this valueMethods inherited from class com.yahoo.jrt.Value
asData, asDataArray, asDouble, asDoubleArray, asFloat, asFloatArray, asInt16, asInt16Array, asInt32, asInt32Array, asInt64, asInt64Array, asInt8, asInt8Array, asStringArray
-
Constructor Details
-
StringValue
Create from a Java-type value- Parameters:
value
- the value
-
StringValue
public StringValue(com.yahoo.text.Utf8String value) -
StringValue
public StringValue(com.yahoo.text.Utf8Array value)
-
-
Method Details
-
type
public byte type()Description copied from class:Value
Obtain the type identifier for this value -
count
public int count()Description copied from class:Value
Obtain the number of entries stored in this value. This is 1 for basic data types and the size of the array for array types. -
asString
Description copied from class:Value
Interpret this value as aStringValue
and return the contents as an appropriate Java type -
asUtf8Array
public com.yahoo.text.Utf8Array asUtf8Array()Description copied from class:Value
Interpret this value as aStringValue
and return the contents as an appropriate Java type- Overrides:
asUtf8Array
in classValue
- Returns:
- the value contained in this object as a Java type
-
toString
Description copied from class:Value
Force a proper toString
-