Interface TraceObjectValue

All Known Implementing Classes:
DBTraceObjectValue

public interface TraceObjectValue
  • Method Details

    • getTrace

      Trace getTrace()
      Get the trace containing this value entry
      Returns:
      the trace
    • getParent

      TraceObject getParent()
      Get the parent object of this entry
      Returns:
      the parent
    • getEntryKey

      String getEntryKey()
      Get the key identifying this child to its parent
      Returns:
      the key
    • hasEntryKey

      default boolean hasEntryKey(String keyOrAlias)
      Check if the given key (or alias) matches this entry's key
      Parameters:
      keyOrAlias - the key or alias
      Returns:
      true if the key matches this entry's key, or it is an alias for it
    • getCanonicalPath

      KeyPath getCanonicalPath()
      Get the "canonical path" of this value

      This is the parent's canonical path extended by this value's entry key. Note, in the case this value has a child object, this is not necessarily its canonical path.

      Returns:
      the canonical path
    • getValue

      Object getValue()
      Get the value
      Returns:
      the value
    • castValue

      default <T> T castValue()
      A convenience to get and cast the value, without checking
      Type Parameters:
      T - the desired type
      Returns:
      the value
    • getChild

      TraceObject getChild()
      Get the value as an object
      Returns:
      the child
      Throws:
      ClassCastException - if the value is not an object
    • isObject

      boolean isObject()
      Check if the value is an object (i.e., TraceObject)
      Returns:
      true if an object, false otherwise
    • isCanonical

      boolean isCanonical()
      Check if this value represents its child's canonical location

      The value is canonical if the parent's canonical path extended by this value's key gives the child's canonical path. If the value is not a child object, the value cannot be canonical.

      Returns:
      true if canonical
    • getTargetSchema

      default TraceObjectSchema getTargetSchema()
      Get the (target) schema for the value
      Returns:
      the schema
    • setLifespan

      void setLifespan(Lifespan lifespan)
      Set the lifespan of this entry, truncating duplicates
      Parameters:
      lifespan - the new lifespan
    • setLifespan

      void setLifespan(Lifespan span, TraceObject.ConflictResolution resolution)
      Set the lifespan of this entry

      NOTE: For storage efficiency, when expanding the lifespan, the manager may coalesce this value with intersecting values having equal keys and values. Thus, the resulting lifespan may be larger than specified.

      Values cannot intersect and have the same key, otherwise the value of that key could not be uniquely determined at a given snap. Thus, when lifespans are being adjusted, such conflicts must be resolved.

      Parameters:
      span - the new lifespan
      resolution - specifies how to resolve duplicate keys with intersecting lifespans
      Throws:
      DuplicateKeyException - if there are denied duplicate keys
    • getLifespan

      Lifespan getLifespan()
      Get the lifespan of this entry
      Returns:
      the lifespan
    • setMinSnap

      void setMinSnap(long minSnap)
      Set the minimum snap of this entry
      Parameters:
      minSnap - the minimum snap, or Long.MIN_VALUE for "since the beginning of time"
      See Also:
    • getMinSnap

      long getMinSnap()
      Get the minimum snap of this entry
      Returns:
      the minimum snap, or Long.MIN_VALUE for "since the beginning of time"
    • setMaxSnap

      void setMaxSnap(long maxSnap)
      Set the maximum snap of this entry
      Parameters:
      maxSnap - the maximum snap, or Long.MAX_VALUE for "to the end of time"
      See Also:
    • getMaxSnap

      long getMaxSnap()
      Get the maximum snap of this entry
      Returns:
      the maximum snap, or Long.MAX_VALUE for "to the end of time"
    • delete

      void delete()
      Delete this entry
    • isDeleted

      boolean isDeleted()
      Check if this value entry has been deleted
      Returns:
      true if the entry has been deleted
    • truncateOrDelete

      TraceObjectValue truncateOrDelete(Lifespan span)
      Modify the lifespan or delete this entry, such that it no longer intersects the given span.

      If the given span and the current lifespan are already disjoint, this does nothing. If the given span splits the current lifespan in two, then a new entry is created for the later lifespan.

      Parameters:
      span - the span to clear
      Returns:
      this if the one entry remains, null if the entry is deleted, or the generated entry if a second is created.
    • isHidden

      default boolean isHidden()
      Check if the schema designates this value as hidden
      Returns:
      true if hidden