Class ComplexValue


  • public class ComplexValue
    extends Object
    Value as list of key/value pairs
    • Constructor Detail

      • ComplexValue

        public ComplexValue​(String key,
                            byte[] value)
    • Method Detail

      • serialize

        public byte[] serialize()
      • deserialize

        public static ComplexValue deserialize​(byte[] bytes)
        Deserialize whole list of ComplexValues
        Parameters:
        bytes -
      • get

        public byte[] get​(String key)
        Get value by exact key
        Parameters:
        key -
        Returns:
      • get

        public byte[] get​(long key)
        Get value by exact key
        Parameters:
        key -
        Returns:
      • updateWithRAW

        public ComplexValue updateWithRAW​(byte[] raw)
        Insert values from raw into current ComplexValuesList. Return ComplexValue(key=null, val=null, next=result list)
        Parameters:
        raw - complexValue list byte[] representation
        Returns:
        ComplexValue where next = result
      • remove

        public ComplexValue remove​(String key)
        Remove key/value pair by exact key
        Parameters:
        key -
        Returns:
        ComplexValue with key/value of removed value and next = new head
      • insert

        public ComplexValue insert​(String key,
                                   byte[] value)
        Insert new value into list and return ComplexValue with next = new list
        Parameters:
        key -
        value -
        Returns:
      • insert

        public ComplexValue insert​(long key,
                                   byte[] value)
      • getKey

        public String getKey()
        Get key of current (first) cv entry
        Returns:
        the key
      • getValue

        public byte[] getValue()
        Get value of current (first) cv entry
        Returns:
        the value
      • getNext

        public ComplexValue getNext()
        Get next CV entry
        Returns:
        the next
      • setNext

        public void setNext​(ComplexValue next)
        Set next CV entry
        Parameters:
        next - the next to set
      • getLength

        public int getLength()
        Calculate list length
        Returns: