Class MapRecord

java.lang.Object
org.nustaq.reallive.records.MapRecord
All Implemented Interfaces:
Serializable, Record, EvalContext

public class MapRecord extends Object implements Record
Created by ruedi on 04.08.2015. a record stored by reallive.
See Also:
  • Field Details

  • Constructor Details

    • MapRecord

      protected MapRecord()
  • Method Details

    • New

      public static MapRecord New(String key)
    • New

      public static MapRecord New(String key, Object... values)
    • size

      public int size()
    • getKey

      public String getKey()
      Specified by:
      getKey in interface Record
    • getLastModified

      public long getLastModified()
      Specified by:
      getLastModified in interface Record
    • internal_setLastModified

      public void internal_setLastModified(long tim)
      Specified by:
      internal_setLastModified in interface Record
    • internal_incSequence

      public void internal_incSequence()
      Specified by:
      internal_incSequence in interface Record
    • getSequence

      public long getSequence()
      Specified by:
      getSequence in interface Record
    • internal_put

      public Record internal_put(String key, Object value)
      Specified by:
      internal_put in interface Record
    • key

      public Record key(String key)
      Description copied from interface: Record
      take care, kind of dangerous
      Specified by:
      key in interface Record
    • getFields

      public String[] getFields()
      Specified by:
      getFields in interface Record
    • get

      public Object get(String field)
      Specified by:
      get in interface EvalContext
    • put

      public MapRecord put(String key, Object value)
      Description copied from interface: Record
      puts a key value pair. type checking is applied to ensure data is json compatible. if value is null, the key is removed.
      Specified by:
      put in interface Record
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • shallowCopy

      public MapRecord shallowCopy()
      Specified by:
      shallowCopy in interface Record
      Returns:
      a shallow copy
    • transformCopy

      public Record transformCopy(TransformFunction transform)
      Description copied from interface: Record
      copies recursively applying given function to each value. if the transform returns v, its an identity copy if the transform returns null, the given key is removed from outer record. (if outer container is array, its removed)
      Specified by:
      transformCopy in interface Record
      Returns:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getFieldSet

      public Set<String> getFieldSet()
      Specified by:
      getFieldSet in interface Record
    • main

      public static void main(String[] args)
    • _afterLoad

      public boolean _afterLoad()
      Description copied from interface: Record
      called by the persistance layer after a record has been loaded from disk. can be used for type migration of an existing database. return true if the record should be re-persisted
      Specified by:
      _afterLoad in interface Record
    • containsKey

      public boolean containsKey(String x)
      Specified by:
      containsKey in interface Record