Package com.kuzudb
Class ValueStructUtil
java.lang.Object
com.kuzudb.ValueStructUtil
Utility functions for Value of struct type.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getFieldNameByIndex
(Value value, long index) Get the name of the field at the given index from the given struct value.static long
getIndexByFieldName
(Value value, String fieldName) Get the index of the field with the given name from the given struct value.static long
getNumFields
(Value value) Get the number of fields of the struct value.static Value
getValueByFieldName
(Value value, String fieldName) Get the value of the field with the given name from the given struct value.static Value
getValueByIndex
(Value value, long index) Get the value of the field at the given index from the given struct value.
-
Constructor Details
-
ValueStructUtil
public ValueStructUtil()
-
-
Method Details
-
getNumFields
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
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.
-