Class ShareRetentionPolicy

java.lang.Object
com.azure.storage.file.share.models.ShareRetentionPolicy
All Implemented Interfaces:
com.azure.xml.XmlSerializable<ShareRetentionPolicy>

public final class ShareRetentionPolicy extends Object implements com.azure.xml.XmlSerializable<ShareRetentionPolicy>
The retention policy.
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    fromXml(com.azure.xml.XmlReader xmlReader)
    Reads an instance of ShareRetentionPolicy from the XmlReader.
    fromXml(com.azure.xml.XmlReader xmlReader, String rootElementName)
    Reads an instance of ShareRetentionPolicy from the XmlReader.
    Get the days property: Indicates the number of days that metrics data should be retained.
    boolean
    Get the enabled property: Indicates whether a retention policy is enabled for the File service.
    Set the days property: Indicates the number of days that metrics data should be retained.
    setEnabled(boolean enabled)
    Set the enabled property: Indicates whether a retention policy is enabled for the File service.
    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

    • ShareRetentionPolicy

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

    • isEnabled

      public boolean isEnabled()
      Get the enabled property: Indicates whether a retention policy is enabled for the File service. If false, metrics data is retained, and the user is responsible for deleting it.
      Returns:
      the enabled value.
    • setEnabled

      public ShareRetentionPolicy setEnabled(boolean enabled)
      Set the enabled property: Indicates whether a retention policy is enabled for the File service. If false, metrics data is retained, and the user is responsible for deleting it.
      Parameters:
      enabled - the enabled value to set.
      Returns:
      the ShareRetentionPolicy object itself.
    • getDays

      public Integer getDays()
      Get the days property: Indicates the number of days that metrics data should be retained. All data older than this value will be deleted. Metrics data is deleted on a best-effort basis after the retention period expires.
      Returns:
      the days value.
    • setDays

      public ShareRetentionPolicy setDays(Integer days)
      Set the days property: Indicates the number of days that metrics data should be retained. All data older than this value will be deleted. Metrics data is deleted on a best-effort basis after the retention period expires.
      Parameters:
      days - the days value to set.
      Returns:
      the ShareRetentionPolicy 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<ShareRetentionPolicy>
      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<ShareRetentionPolicy>
      Throws:
      XMLStreamException
    • fromXml

      public static ShareRetentionPolicy fromXml(com.azure.xml.XmlReader xmlReader) throws XMLStreamException
      Reads an instance of ShareRetentionPolicy from the XmlReader.
      Parameters:
      xmlReader - The XmlReader being read.
      Returns:
      An instance of ShareRetentionPolicy 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 ShareRetentionPolicy.
    • fromXml

      public static ShareRetentionPolicy fromXml(com.azure.xml.XmlReader xmlReader, String rootElementName) throws XMLStreamException
      Reads an instance of ShareRetentionPolicy 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 ShareRetentionPolicy 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 ShareRetentionPolicy.