Class TimeWindow
- java.lang.Object
-
- microsoft.exchange.webservices.data.misc.availability.TimeWindow
-
- All Implemented Interfaces:
ISelfValidate
public class TimeWindow extends Object implements ISelfValidate
Represents a time period.
-
-
Constructor Summary
Constructors Constructor Description TimeWindow()Initializes a new instance of the "TimeWindow" class.TimeWindow(Date startTime, Date endTime)Initializes a new instance of the "TimeWindow" class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetDuration()Gets the duration.DategetEndTime()Gets the end time.DategetStartTime()Gets the start time.voidloadFromXml(EwsServiceXmlReader reader)Loads from XML.voidsetEndTime(Date endTime)Sets the end time.voidsetStartTime(Date startTime)Sets the start time.voidvalidate()Validates this instance.voidwriteToXml(EwsServiceXmlWriter writer, String xmlElementName)Writes to XML.protected voidwriteToXmlUnscopedDatesOnly(EwsServiceXmlWriter writer, String xmlElementName)Writes to XML without scoping the dates and without emitting times.
-
-
-
Constructor Detail
-
TimeWindow
public TimeWindow()
Initializes a new instance of the "TimeWindow" class.
-
TimeWindow
public TimeWindow(Date startTime, Date endTime)
Initializes a new instance of the "TimeWindow" class.- Parameters:
startTime- the start timeendTime- the end time
-
-
Method Detail
-
getStartTime
public Date getStartTime()
Gets the start time.- Returns:
- the start time
-
setStartTime
public void setStartTime(Date startTime)
Sets the start time.- Parameters:
startTime- the new start time
-
getEndTime
public Date getEndTime()
Gets the end time.- Returns:
- the end time
-
setEndTime
public void setEndTime(Date endTime)
Sets the end time.- Parameters:
endTime- the new end time
-
loadFromXml
public void loadFromXml(EwsServiceXmlReader reader) throws Exception
Loads from XML.- Parameters:
reader- the reader- Throws:
Exception- the exception
-
writeToXmlUnscopedDatesOnly
protected void writeToXmlUnscopedDatesOnly(EwsServiceXmlWriter writer, String xmlElementName) throws XMLStreamException, ServiceXmlSerializationException
Writes to XML without scoping the dates and without emitting times.- Parameters:
writer- the writerxmlElementName- the xml element name- Throws:
XMLStreamException- the XML stream exceptionServiceXmlSerializationException- the service xml serialization exception
-
writeToXml
public void writeToXml(EwsServiceXmlWriter writer, String xmlElementName) throws XMLStreamException, ServiceXmlSerializationException
Writes to XML.- Parameters:
writer- the writerxmlElementName- the xml element name- Throws:
XMLStreamException- the XML stream exceptionServiceXmlSerializationException- the service xml serialization exception
-
getDuration
public long getDuration()
Gets the duration.- Returns:
- the duration
-
validate
public void validate()
Validates this instance.- Specified by:
validatein interfaceISelfValidate
-
-