Interface TraceObjectValue
- All Known Implementing Classes:
DBTraceObjectValue
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> TA convenience to get and cast the value, without checkingvoiddelete()Delete this entryGet the "canonical path" of this valuegetChild()Get the value as an objectGet the key identifying this child to its parentGet the lifespan of this entrylongGet the maximum snap of this entrylongGet the minimum snap of this entryGet the parent object of this entrydefault TraceObjectSchemaGet the (target) schema for the valuegetTrace()Get the trace containing this value entrygetValue()Get the valuedefault booleanhasEntryKey(String keyOrAlias) Check if the given key (or alias) matches this entry's keybooleanCheck if this value represents its child's canonical locationbooleanCheck if this value entry has been deleteddefault booleanisHidden()Check if the schema designates this value as hiddenbooleanisObject()Check if the value is an object (i.e.,TraceObject)voidsetLifespan(Lifespan lifespan) Set the lifespan of this entry, truncating duplicatesvoidsetLifespan(Lifespan span, TraceObject.ConflictResolution resolution) Set the lifespan of this entryvoidsetMaxSnap(long maxSnap) Set the maximum snap of this entryvoidsetMinSnap(long minSnap) Set the minimum snap of this entrytruncateOrDelete(Lifespan span) Modify the lifespan or delete this entry, such that it no longer intersects the given span.
-
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
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 valueThis 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 locationThe 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
Get the (target) schema for the value- Returns:
- the schema
-
setLifespan
Set the lifespan of this entry, truncating duplicates- Parameters:
lifespan- the new lifespan
-
setLifespan
Set the lifespan of this entryNOTE: 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 lifespanresolution- 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, orLong.MIN_VALUEfor "since the beginning of time"- See Also:
-
getMinSnap
long getMinSnap()Get the minimum snap of this entry- Returns:
- the minimum snap, or
Long.MIN_VALUEfor "since the beginning of time"
-
setMaxSnap
void setMaxSnap(long maxSnap) Set the maximum snap of this entry- Parameters:
maxSnap- the maximum snap, orLong.MAX_VALUEfor "to the end of time"- See Also:
-
getMaxSnap
long getMaxSnap()Get the maximum snap of this entry- Returns:
- the maximum snap, or
Long.MAX_VALUEfor "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
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
-