Package com.kuzudb

Class ValueStructUtil

java.lang.Object
com.kuzudb.ValueStructUtil

public class ValueStructUtil extends Object
Utility functions for Value of struct type.
  • Constructor Details

    • ValueStructUtil

      public ValueStructUtil()
  • Method Details

    • getNumFields

      public static long getNumFields(Value value) throws ObjectRefDestroyedException
      Get the number of fields of the struct value.
      Parameters:
      value - : The struct value.
      Returns:
      The number of fields of the struct value.
      Throws:
      ObjectRefDestroyedException - If the struct value has been destroyed.
    • getIndexByFieldName

      public static long getIndexByFieldName(Value value, String fieldName) throws ObjectRefDestroyedException
      Get the index of the field with the given name from the given struct value.
      Parameters:
      value - : The struct value.
      fieldName - : The name of the field.
      Returns:
      The index of the field with the given name from the given struct value.
      Throws:
      ObjectRefDestroyedException - If the struct value has been destroyed.
    • getFieldNameByIndex

      public static String getFieldNameByIndex(Value value, long index) throws ObjectRefDestroyedException
      Get the name of the field at the given index from the given struct value.
      Parameters:
      value - : The struct value.
      index - : The index of the field.
      Returns:
      The name of the field at the given index from the given struct value.
      Throws:
      ObjectRefDestroyedException - If the struct value has been destroyed.
    • getValueByFieldName

      public static Value getValueByFieldName(Value value, String fieldName) throws ObjectRefDestroyedException
      Get the value of the field with the given name from the given struct value.
      Parameters:
      value - : The struct value.
      fieldName - : The name of the field.
      Returns:
      The value of the field with the given name from the given struct value.
      Throws:
      ObjectRefDestroyedException - If the struct value has been destroyed.
    • getValueByIndex

      public static Value getValueByIndex(Value value, long index) throws ObjectRefDestroyedException
      Get the value of the field at the given index from the given struct value.
      Parameters:
      value - : The struct value.
      index - : The index of the field.
      Returns:
      The value of the field at the given index from the given struct value.
      Throws:
      ObjectRefDestroyedException - If the struct value has been destroyed.