Class NodeLedgerTypeId

java.lang.Object
space.subkek.nodeledger.NodeLedgerTypeId

public final class NodeLedgerTypeId extends Object
NODELEDGER built-in and custom type identifier support.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    Type id for boolean values.
    static final long
    Type id for raw byte values.
    static final long
    Type id for 64-bit floating point values.
    static final long
    Type id for signed 32-bit integer values.
    static final long
    Type id for signed 64-bit integer values.
    static final long
    Type id for list values.
    static final long
    Type id for nested nodes.
    static final long
    Type id for null values.
    static final long
    Type id for UTF-8 string values.
    static final long
    Type id for unsigned 64-bit integer values.
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    pack(String name)
    Packs an ASCII type name into a NODELEDGER type id.
    static String
    unpack(long typeId)
    Unpacks a NODELEDGER type id into an ASCII type name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NODE

      public static final long NODE
      Type id for nested nodes.
      See Also:
    • NULL

      public static final long NULL
      Type id for null values.
    • BOOL

      public static final long BOOL
      Type id for boolean values.
    • I32

      public static final long I32
      Type id for signed 32-bit integer values.
    • I64

      public static final long I64
      Type id for signed 64-bit integer values.
    • U64

      public static final long U64
      Type id for unsigned 64-bit integer values.
    • F64

      public static final long F64
      Type id for 64-bit floating point values.
    • STR

      public static final long STR
      Type id for UTF-8 string values.
    • BYTES

      public static final long BYTES
      Type id for raw byte values.
    • LIST

      public static final long LIST
      Type id for list values.
  • Method Details

    • pack

      public static long pack(String name)
      Packs an ASCII type name into a NODELEDGER type id.
      Parameters:
      name - ASCII type name with at most eight bytes.
      Returns:
      packed type id.
    • unpack

      public static String unpack(long typeId)
      Unpacks a NODELEDGER type id into an ASCII type name.
      Parameters:
      typeId - packed type id.
      Returns:
      unpacked type name.