Package com.azure.storage.queue.models
Class QueueRetentionPolicy
java.lang.Object
com.azure.storage.queue.models.QueueRetentionPolicy
- All Implemented Interfaces:
com.azure.xml.XmlSerializable<QueueRetentionPolicy>
public final class QueueRetentionPolicy
extends Object
implements com.azure.xml.XmlSerializable<QueueRetentionPolicy>
the retention policy.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic QueueRetentionPolicy
fromXml
(com.azure.xml.XmlReader xmlReader) Reads an instance of QueueRetentionPolicy from the XmlReader.static QueueRetentionPolicy
Reads an instance of QueueRetentionPolicy from the XmlReader.getDays()
Get the days property: Indicates the number of days that metrics or logging or soft-deleted data should be retained.boolean
Get the enabled property: Indicates whether a retention policy is enabled for the storage service.Set the days property: Indicates the number of days that metrics or logging or soft-deleted data should be retained.setEnabled
(boolean enabled) Set the enabled property: Indicates whether a retention policy is enabled for the storage service.com.azure.xml.XmlWriter
toXml
(com.azure.xml.XmlWriter xmlWriter) com.azure.xml.XmlWriter
-
Constructor Details
-
QueueRetentionPolicy
public QueueRetentionPolicy()Creates an instance of QueueRetentionPolicy class.
-
-
Method Details
-
isEnabled
public boolean isEnabled()Get the enabled property: Indicates whether a retention policy is enabled for the storage service.- Returns:
- the enabled value.
-
setEnabled
Set the enabled property: Indicates whether a retention policy is enabled for the storage service.- Parameters:
enabled
- the enabled value to set.- Returns:
- the QueueRetentionPolicy object itself.
-
getDays
Get the days property: Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted.- Returns:
- the days value.
-
setDays
Set the days property: Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted.- Parameters:
days
- the days value to set.- Returns:
- the QueueRetentionPolicy object itself.
-
toXml
- Specified by:
toXml
in interfacecom.azure.xml.XmlSerializable<QueueRetentionPolicy>
- Throws:
XMLStreamException
-
toXml
public com.azure.xml.XmlWriter toXml(com.azure.xml.XmlWriter xmlWriter, String rootElementName) throws XMLStreamException - Specified by:
toXml
in interfacecom.azure.xml.XmlSerializable<QueueRetentionPolicy>
- Throws:
XMLStreamException
-
fromXml
public static QueueRetentionPolicy fromXml(com.azure.xml.XmlReader xmlReader) throws XMLStreamException Reads an instance of QueueRetentionPolicy from the XmlReader.- Parameters:
xmlReader
- The XmlReader being read.- Returns:
- An instance of QueueRetentionPolicy 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 QueueRetentionPolicy.
-
fromXml
public static QueueRetentionPolicy fromXml(com.azure.xml.XmlReader xmlReader, String rootElementName) throws XMLStreamException Reads an instance of QueueRetentionPolicy 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 QueueRetentionPolicy 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 QueueRetentionPolicy.
-