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 a) listen to it, if it's a container object, and get callbacks for each sub-entry b) read as an object using the {val()
} method. Please note that it creates objects and expect more memory usage c) 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 Classes Modifier and Type Interface Description static interface
DataEntry.EntryListener
static interface
DataEntry.FastDecoder
static class
DataEntry.Type
The types are a superset of json
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
boolVal()
Object
ctx()
This is the object shared in the parent container in the {listenContainer(Object, EntryListener)
} methodint
depth()
Depth of this Object.double
doubleVal()
float
floatVal()
long
index()
The index of this entry in the containerint
intVal()
boolean
isKeyValEntry()
If this object is a key value entry.int
length()
If it is a non-primitive type type and size is known in advancevoid
listenContainer(Object ctx, DataEntry.EntryListener listener)
Register a listener to get callbacks for all entrieslong
longVal()
Object
metadata()
Some Objects may have metadata.CharSequence
name()
The name, if this is a map entry , else it returns a nullDataEntry
parent()
If this is a child of another container object this returns a non-null valuedefault String
strValue()
DataEntry.Type
type()
The data typeObject
val()
The object value
-
-
-
Method Detail
-
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
default String strValue()
-
val
Object val()
The object value
-
listenContainer
void listenContainer(Object ctx, DataEntry.EntryListener listener)
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 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
-
-