Package org.apache.solr.common.util
Interface DataEntry
- All Known Implementing Classes:
FastJavaBinDecoder.EntryImpl
public interface DataEntry
This represents a data entry in the payload/stream. There are multiple ways to consume the data
entry: 1) listen to it, if it's a container object, and get callbacks for each sub-entry 2) read
as an object using the {
val()} method. Please note that it creates objects and expect
more memory usage 3) read the corresponding primitive value Do not keep a reference of this
Object beyond the scope where it is called. Read the relevant data out.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacestatic enumThe types are a superset of json -
Method Summary
Modifier and TypeMethodDescriptionbooleanboolVal()ctx()This is the object shared in the parent container in the {listenContainer(Object, EntryListener)} methodintdepth()Depth of this Object.doublefloatfloatVal()longindex()The index of this entry in the containerintintVal()booleanIf this object is a key value entry.intlength()If it is a non-primitive type and size is known in advancevoidlistenContainer(Object ctx, DataEntry.EntryListener listener) Register a listener to get callbacks for all entrieslonglongVal()metadata()Some Objects may have metadata.name()The name, if this is a map entry , else it returns a nullparent()If this is a child of another container object this returns a non-null valuedefault StringstrValue()type()The data typeval()The object value
-
Method Details
-
type
DataEntry.Type type()The data type -
index
long index()The index of this entry in the container -
intVal
int intVal() -
longVal
long longVal() -
floatVal
float floatVal() -
doubleVal
double doubleVal() -
boolVal
boolean boolVal() -
strValue
-
val
Object val()The object value -
listenContainer
Register a listener to get callbacks for all entries- Parameters:
ctx- This is any object that should be shared with the child entry callbackslistener- The listener that handles each entry in this container
-
metadata
Object metadata()Some Objects may have metadata. usually there is none -
depth
int depth()Depth of this Object. The root most object has a depth of 1 -
parent
DataEntry parent()If this is a child of another container object this returns a non-null value- Returns:
- the parent container object
-
ctx
Object ctx()This is the object shared in the parent container in the {listenContainer(Object, EntryListener)} method -
length
int length()If it is a non-primitive type and size is known in advanceif it's a map/list, it's the no:of items in this container
if it's a {
CharSequence} or byte[] , it's the no:of bytes in the stream- Returns:
- a number greater than or equal to zero if the size is known, -1 if unknown
-
isKeyValEntry
boolean isKeyValEntry()If this object is a key value entry. key value entries have name -
name
CharSequence name()The name, if this is a map entry , else it returns a null
-