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.
    • Method Detail

      • 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 callbacks
        listener - 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
      • length

        int length()
        If it is a non-primitive type type and size is known in advance

        if 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