Entry.java

  1. package com.surrealdb;

  2. /**
  3.  * Entry represents a key-value pair entry in a native data structure.
  4.  * <p>
  5.  * Entry provides methods to retrieve the key and value associated with the entry.
  6.  */
  7. public class Entry extends Native {

  8.     Entry(long ptr) {
  9.         super(ptr);
  10.     }

  11.     private static native String getKey(long ptr);

  12.     private static native long getValue(long ptr);

  13.     @Override
  14.     final native String toString(long ptr);

  15.     @Override
  16.     final native int hashCode(long ptr);

  17.     @Override
  18.     final native boolean equals(long ptr1, long ptr2);

  19.     @Override
  20.     final native boolean deleteInstance(long ptr);

  21.     public String getKey() {
  22.         return getKey(getPtr());
  23.     }

  24.     public Value getValue() {
  25.         return new Value(getValue(getPtr()));
  26.     }

  27. }