Package com.kuzudb

Class Value

java.lang.Object
com.kuzudb.Value
All Implemented Interfaces:
AutoCloseable

public class Value extends Object implements AutoCloseable
Value can hold data of different types.
  • Field Details

    • v_ref

      public long v_ref
  • Constructor Details

  • Method Details

    • createNull

      public static Value createNull()
      Create a null Value.
      Returns:
      The null Value.
    • createNullWithDataType

      public static Value createNullWithDataType(DataType data_type)
      Create a null Value with the given data type.
      Parameters:
      data_type - : The data type of the null Value.
    • createDefault

      public static Value createDefault(DataType data_type)
      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() throws ObjectRefDestroyedException
      Check if the Value has been destroyed.
      Throws:
      ObjectRefDestroyedException - If the Value has been destroyed.
    • close

      public void close() throws ObjectRefDestroyedException
      Close the value and release the underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.
      Specified by:
      close in interface AutoCloseable
      Throws:
      ObjectRefDestroyedException - If the Value has been destroyed.
    • isOwnedByCPP

      public boolean isOwnedByCPP()
    • isNull

      public boolean isNull() throws ObjectRefDestroyedException
      Check if the Value is null.
      Returns:
      True if the Value is null, false otherwise.
      Throws:
      ObjectRefDestroyedException - If the Value has been destroyed.
    • setNull

      public void setNull(boolean flag) throws ObjectRefDestroyedException
      Set the Value to null.
      Parameters:
      flag - : True if the Value is set to null, false otherwise.
      Throws:
      ObjectRefDestroyedException - If the Value has been destroyed.
    • copy

      public void copy(Value other) throws ObjectRefDestroyedException
      Copy the Value from another Value.
      Parameters:
      other - : The Value to copy from.
      Throws:
      ObjectRefDestroyedException - If the Value has been destroyed.
    • clone

      public Value clone()
      Clone the Value.
      Overrides:
      clone in class Object
      Returns:
      The cloned Value.
    • getValue

      public <T> T getValue() throws ObjectRefDestroyedException
      Get the actual value from the Value.
      Returns:
      The value of the given type.
      Throws:
      ObjectRefDestroyedException - If the Value has been destroyed.
    • getDataType

      public DataType getDataType() throws ObjectRefDestroyedException
      Get the data type of the Value.
      Returns:
      The data type of the Value.
      Throws:
      ObjectRefDestroyedException - If the Value has been destroyed.
    • toString

      public String toString()
      Convert the Value to string.
      Overrides:
      toString in class Object
      Returns:
      The current value in string format.