Interface UdtValue
-
- All Superinterfaces:
AccessibleById,AccessibleByIndex,AccessibleByName,Data,GettableById,GettableByIndex,GettableByName,SettableById<UdtValue>,SettableByIndex<UdtValue>,SettableByName<UdtValue>
public interface UdtValue extends GettableById, GettableByName, SettableById<UdtValue>, SettableByName<UdtValue>
Driver-side representation of an instance of a CQL user defined type.It is an ordered set of named, typed fields.
A tuple value is attached if and only if its type is attached (see
Detachable).The default implementation returned by the driver is mutable and serializable. If you write your own implementation, serializability is not mandatory, but recommended for use with some 3rd-party tools like Apache Spark ™.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default StringgetFormattedContents()Returns a string representation of the contents of this UDT.UserDefinedTypegetType()StringtoString()Returns an abstract representation of this object, that may not include the UDT's contents.-
Methods inherited from interface com.datastax.oss.driver.api.core.data.AccessibleById
allIndicesOf, firstIndexOf
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.AccessibleByIndex
getType, size
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.AccessibleByName
allIndicesOf, firstIndexOf
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.Data
codecRegistry, protocolVersion
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.GettableById
get, get, get, getBigDecimal, getBigInteger, getBool, getBoolean, getByte, getByteBuffer, getBytesUnsafe, getCqlDuration, getDouble, getFloat, getInetAddress, getInstant, getInt, getList, getLocalDate, getLocalTime, getLong, getMap, getObject, getSet, getShort, getString, getToken, getTupleValue, getUdtValue, getUuid, getVector, isNull
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.GettableByIndex
get, get, get, getBigDecimal, getBigInteger, getBool, getBoolean, getByte, getByteBuffer, getBytesUnsafe, getCqlDuration, getDouble, getFloat, getInetAddress, getInstant, getInt, getList, getLocalDate, getLocalTime, getLong, getMap, getObject, getSet, getShort, getString, getToken, getTupleValue, getUdtValue, getUuid, getVector, isNull
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.GettableByName
get, get, get, getBigDecimal, getBigInteger, getBool, getBoolean, getByte, getByteBuffer, getBytesUnsafe, getCqlDuration, getDouble, getFloat, getInetAddress, getInstant, getInt, getList, getLocalDate, getLocalTime, getLong, getMap, getObject, getSet, getShort, getString, getToken, getTupleValue, getUdtValue, getUuid, getVector, isNull
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.SettableById
getType, set, set, set, setBigDecimal, setBigInteger, setBool, setBoolean, setByte, setByteBuffer, setBytesUnsafe, setCqlDuration, setDouble, setFloat, setInetAddress, setInstant, setInt, setList, setLocalDate, setLocalTime, setLong, setMap, setSet, setShort, setString, setToken, setToNull, setTupleValue, setUdtValue, setUuid, setVector
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.SettableByIndex
set, set, set, setBigDecimal, setBigInteger, setBool, setBoolean, setByte, setByteBuffer, setBytesUnsafe, setCqlDuration, setDouble, setFloat, setInetAddress, setInstant, setInt, setList, setLocalDate, setLocalTime, setLong, setMap, setSet, setShort, setString, setToken, setToNull, setTupleValue, setUdtValue, setUuid, setVector
-
Methods inherited from interface com.datastax.oss.driver.api.core.data.SettableByName
getType, set, set, set, setBigDecimal, setBigInteger, setBool, setBoolean, setByte, setByteBuffer, setBytesUnsafe, setCqlDuration, setDouble, setFloat, setInetAddress, setInstant, setInt, setList, setLocalDate, setLocalTime, setLong, setMap, setSet, setShort, setString, setToken, setToNull, setTupleValue, setUdtValue, setUuid, setVector
-
-
-
-
Method Detail
-
getType
@NonNull UserDefinedType getType()
-
getFormattedContents
@NonNull default String getFormattedContents()
Returns a string representation of the contents of this UDT.This produces a CQL literal, for example:
{street:'42 Main Street',zip:12345}Notes:- This method does not sanitize its output in any way. In particular, no effort is made to limit output size: all fields are included, and large strings or blobs will be appended as-is.
- Be mindful of how you expose the result. For example, in high-security environments, it might be undesirable to leak data in application logs.
-
toString
String toString()
Returns an abstract representation of this object, that may not include the UDT's contents.The driver's built-in
UdtValueimplementation returns the default format ofObject.toString(): the class name, followed by the at-sign and the hash code of the object.Omitting the contents was a deliberate choice, because we feel it would make it too easy to accidentally leak data (e.g. in application logs). If you want the contents, use
getFormattedContents().
-
-