Class Block


  • public class Block
    extends java.lang.Object
    PcapNG format is made of blocks. This class abstracts one block.
    • Constructor Summary

      Constructors 
      Constructor Description
      Block​(BlockType type, java.lang.Object o, java.util.List<Option> options)
      Create a block of a given type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsDataOfType​(java.lang.Class<?> dataType)
      Returns true if this block contains a data of a given type.
      java.lang.Object data()
      Returns the data object.
      Option[] options()
      Returns an array of options that are attached to this block.
      java.lang.String toString()  
      BlockType type()
      Returns the type of the block.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Block

        public Block​(BlockType type,
                     java.lang.Object o,
                     java.util.List<Option> options)
        Create a block of a given type.
        Parameters:
        type - A block type for this block.
        o - Data of a given type.
        options - Options list that should be appended to the block. May be null or empty.
    • Method Detail

      • options

        public Option[] options()
        Returns an array of options that are attached to this block.
        Returns:
        Returns an array of options. May be empty array. Does not return null.
      • type

        public BlockType type()
        Returns the type of the block.
        Returns:
        block type
      • containsDataOfType

        public boolean containsDataOfType​(java.lang.Class<?> dataType)
        Returns true if this block contains a data of a given type.
        Parameters:
        dataType - Class of data that you're querying for.
        Returns:
        True if the class contains the specified class type of data.
      • data

        public java.lang.Object data()
        Returns the data object.
        Returns:
        data object.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object