Class StringEntry

java.lang.Object
net.quasardb.qdb.kv.Entry
net.quasardb.qdb.kv.StringEntry

public final class StringEntry extends Entry
A string in the database. Blob stands for "Binary Large Object", it's an entry which store binary data.
  • Constructor Details

    • StringEntry

      protected StringEntry(Session session, String alias)
  • Method Details

    • ofAlias

      public static StringEntry ofAlias(Session session, String alias)
    • put

      public void put(String content)
      Create a new string with the specified content. Fails if the string already exists.
      Parameters:
      content - The content of the string to be created.
      Throws:
      AliasAlreadyExistsException - If an entry matching the provided alias already exists.
      ClusterClosedException - If QdbCluster.close() has been called.
      ReservedAliasException - If the alias name or prefix is reserved for quasardb internal use.
    • update

      public boolean update(String content)
      Replaces the content of the string.
      Parameters:
      content - The content of the string to be set.
      Returns:
      true if the string was created, or false it it was updated.
      Throws:
      ClusterClosedException - If QdbCluster.close() has been called.
      IncompatibleTypeException - If the alias has a type incompatible for this operation.
      InvalidArgumentException - If the expiry time is in the past (with a certain tolerance)
      ReservedAliasException - If the alias name or prefix is reserved for quasardb internal use.
    • get

      public String get()
      Read the content of the string.
      Returns:
      The current content.
      Throws:
      AliasNotFoundException - If an entry matching the provided alias cannot be found.
      IncompatibleTypeException - If the alias has a type incompatible for this operation.
      ReservedAliasException - If the alias name or prefix is reserved for quasardb internal use.