Package com.kuzudb
Class Value
java.lang.Object
com.kuzudb.Value
- All Implemented Interfaces:
AutoCloseable
Value can hold data of different types.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCheck if the Value has been destroyed.clone()Clone the Value.voidclose()Close the value and release the underlying resources.voidCopy the Value from another Value.static ValuecreateDefault(DataType data_type) Create a default Value with the given data type.static ValueCreate a null Value.static ValuecreateNullWithDataType(DataType data_type) Create a null Value with the given data type.Get the data type of the Value.<T> TgetValue()Get the actual value from the Value.booleanisNull()Check if the Value is null.booleanvoidsetNull(boolean flag) Set the Value to null.toString()Convert the Value to string.
-
Field Details
-
v_ref
public long v_ref
-
-
Constructor Details
-
Value
public Value(T val) Construct a Value from a val.- Throws:
RuntimeException- If the Value has been destroyed.
-
-
Method Details
-
createNull
Create a null Value.- Returns:
- The null Value.
-
createNullWithDataType
Create a null Value with the given data type.- Parameters:
data_type- : The data type of the null Value.
-
createDefault
Create a default Value with the given data type.- Parameters:
data_type- : The data type of the default Value.- Returns:
- The default Value.
-
checkNotDestroyed
public void checkNotDestroyed()Check if the Value has been destroyed.- Throws:
RuntimeException- If the Value has been destroyed.
-
close
public void close()Close the value and release the underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.- Specified by:
closein interfaceAutoCloseable- Throws:
RuntimeException- If the Value has been destroyed.
-
isOwnedByCPP
public boolean isOwnedByCPP() -
isNull
public boolean isNull()Check if the Value is null.- Returns:
- True if the Value is null, false otherwise.
- Throws:
RuntimeException- If the Value has been destroyed.
-
setNull
public void setNull(boolean flag) Set the Value to null.- Parameters:
flag- : True if the Value is set to null, false otherwise.- Throws:
RuntimeException- If the Value has been destroyed.
-
copy
Copy the Value from another Value.- Parameters:
other- : The Value to copy from.- Throws:
RuntimeException- If the Value has been destroyed.
-
clone
Clone the Value. -
getValue
public <T> T getValue()Get the actual value from the Value.- Returns:
- The value of the given type.
- Throws:
RuntimeException- If the Value has been destroyed.
-
getDataType
Get the data type of the Value.- Returns:
- The data type of the Value.
- Throws:
RuntimeException- If the Value has been destroyed.
-
toString
Convert the Value to string.
-