Class Block

java.lang.Object
com.azure.storage.blob.models.Block
All Implemented Interfaces:
com.azure.xml.XmlSerializable<Block>

public final class Block extends Object implements com.azure.xml.XmlSerializable<Block>
Represents a single block in a block blob. It describes the block's ID and size.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of Block class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Block
    fromXml(com.azure.xml.XmlReader xmlReader)
    Reads an instance of Block from the XmlReader.
    static Block
    fromXml(com.azure.xml.XmlReader xmlReader, String rootElementName)
    Reads an instance of Block from the XmlReader.
    Get the name property: The base64 encoded block ID.
    int
    Deprecated.
    long
    Get the sizeLong property: The block size in bytes.
    Set the name property: The base64 encoded block ID.
    setSize(int sizeInt)
    Deprecated.
    setSizeLong(long sizeLong)
    Set the sizeLong property: The block size in bytes.
    com.azure.xml.XmlWriter
    toXml(com.azure.xml.XmlWriter xmlWriter)
     
    com.azure.xml.XmlWriter
    toXml(com.azure.xml.XmlWriter xmlWriter, String rootElementName)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Block

      public Block()
      Creates an instance of Block class.
  • Method Details

    • getName

      public String getName()
      Get the name property: The base64 encoded block ID.
      Returns:
      the name value.
    • setName

      public Block setName(String name)
      Set the name property: The base64 encoded block ID.
      Parameters:
      name - the name value to set.
      Returns:
      the Block object itself.
    • getSizeLong

      public long getSizeLong()
      Get the sizeLong property: The block size in bytes.
      Returns:
      the sizeLong value.
    • setSizeLong

      public Block setSizeLong(long sizeLong)
      Set the sizeLong property: The block size in bytes.
      Parameters:
      sizeLong - the sizeLong value to set.
      Returns:
      the Block object itself.
    • getSize

      @Deprecated public int getSize()
      Deprecated.
      Get the sizeInt property: The SizeInt property.
      Returns:
      the sizeInt value.
    • setSize

      @Deprecated public Block setSize(int sizeInt)
      Deprecated.
      Set the sizeInt property: The SizeInt property.
      Parameters:
      sizeInt - the sizeInt value to set.
      Returns:
      the Block object itself.
    • toXml

      public com.azure.xml.XmlWriter toXml(com.azure.xml.XmlWriter xmlWriter) throws XMLStreamException
      Specified by:
      toXml in interface com.azure.xml.XmlSerializable<Block>
      Throws:
      XMLStreamException
    • toXml

      public com.azure.xml.XmlWriter toXml(com.azure.xml.XmlWriter xmlWriter, String rootElementName) throws XMLStreamException
      Specified by:
      toXml in interface com.azure.xml.XmlSerializable<Block>
      Throws:
      XMLStreamException
    • fromXml

      public static Block fromXml(com.azure.xml.XmlReader xmlReader) throws XMLStreamException
      Reads an instance of Block from the XmlReader.
      Parameters:
      xmlReader - The XmlReader being read.
      Returns:
      An instance of Block if the XmlReader was pointing to an instance of it, or null if it was pointing to XML null.
      Throws:
      XMLStreamException - If an error occurs while reading the Block.
    • fromXml

      public static Block fromXml(com.azure.xml.XmlReader xmlReader, String rootElementName) throws XMLStreamException
      Reads an instance of Block from the XmlReader.
      Parameters:
      xmlReader - The XmlReader being read.
      rootElementName - Optional root element name to override the default defined by the model. Used to support cases where the model can deserialize from different root element names.
      Returns:
      An instance of Block if the XmlReader was pointing to an instance of it, or null if it was pointing to XML null.
      Throws:
      XMLStreamException - If an error occurs while reading the Block.