Class CBORArray

java.lang.Object
org.webpki.cbor.CBORObject
org.webpki.cbor.CBORArray
All Implemented Interfaces:
Cloneable

public class CBORArray extends CBORObject
Class for holding CBOR array objects.
  • Constructor Details

    • CBORArray

      public CBORArray()
      Creates an empty CBOR array [].
  • Method Details

    • size

      public int size()
      Returns the size of the array.
      Returns:
      The number of objects in the array
    • get

      public CBORObject get(int index)
      Retrieves object at a specific position.
      Parameters:
      index - The position (0..size()-1)
      Returns:
      CBOR object
    • add

      public CBORArray add(CBORObject cborObject)
      Appends object to the array.
      Parameters:
      cborObject - Object to be appended to the array.
      Returns:
      this
    • toArray

      public CBORObject[] toArray()
      Returns the entire array.
      Returns:
      Array of CBOR objects