Class TimeZoneDefinition
- java.lang.Object
-
- microsoft.exchange.webservices.data.property.complex.ComplexProperty
-
- microsoft.exchange.webservices.data.property.complex.time.TimeZoneDefinition
-
- All Implemented Interfaces:
Comparator<TimeZoneTransition>,ISelfValidate,ComplexFunctionDelegate<EwsServiceXmlReader>
- Direct Known Subclasses:
OlsonTimeZoneDefinition
public class TimeZoneDefinition extends ComplexProperty implements Comparator<TimeZoneTransition>
Represents a time zone as defined by the EWS schema.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringDaylightPeriodIdThe Daylight period id.protected StringDaylightPeriodNameThe Daylight period name.StringidThe id.StringnameThe name.protected StringStandardPeriodIdThe Standard period id.protected StringStandardPeriodNameThe Standard period name.
-
Constructor Summary
Constructors Constructor Description TimeZoneDefinition()Initializes a new instance of the TimeZoneDefinition class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(TimeZoneTransition x, TimeZoneTransition y)Compares the transitions.StringgetId()Gets the Id of this time zone definition.StringgetName()Gets the name of this time zone definition.Map<String,TimeZonePeriod>getPeriods()Adds a transition group with a single transition to the specified period.Map<String,TimeZoneTransitionGroup>getTransitionGroups()Gets the transition groups associated with this time zone definition, indexed by Id.voidloadFromXml(EwsServiceXmlReader reader)Loads from XML.voidreadAttributesFromXml(EwsServiceXmlReader reader)Reads the attribute from XML.voidsetId(String id)Sets the id.protected voidsetName(String name)Sets the name.booleantryReadElementFromXml(EwsServiceXmlReader reader)Tries to read element from XML.voidvalidate()Validates this time zone definition.voidwriteAttributesToXml(EwsServiceXmlWriter writer)Writes the attribute to XML.voidwriteElementsToXml(EwsServiceXmlWriter writer)Writes elements to XML.protected voidwriteToXml(EwsServiceXmlWriter writer)Writes to XML.voidwriteToXml(EwsServiceXmlWriter writer, String xmlElementName)Writes to XML.-
Methods inherited from class microsoft.exchange.webservices.data.property.complex.ComplexProperty
addOnChangeEvent, canSetFieldValue, changed, clearChangeEvents, clearChangeLog, func, getNamespace, internalValidate, loadFromXml, loadFromXml, readTextValueFromXml, removeChangeEvent, setNamespace, tryReadElementFromXmlToPatch, updateFromXml, updateFromXml, writeToXml
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Field Detail
-
StandardPeriodId
protected final String StandardPeriodId
The Standard period id.- See Also:
- Constant Field Values
-
StandardPeriodName
protected final String StandardPeriodName
The Standard period name.- See Also:
- Constant Field Values
-
DaylightPeriodId
protected final String DaylightPeriodId
The Daylight period id.- See Also:
- Constant Field Values
-
DaylightPeriodName
protected final String DaylightPeriodName
The Daylight period name.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TimeZoneDefinition
public TimeZoneDefinition()
Initializes a new instance of the TimeZoneDefinition class.
-
-
Method Detail
-
compare
public int compare(TimeZoneTransition x, TimeZoneTransition y)
Compares the transitions.- Specified by:
comparein interfaceComparator<TimeZoneTransition>- Parameters:
x- The first transition.y- The second transition.- Returns:
- A negative number if x is less than y, 0 if x and y are equal, a positive number if x is greater than y.
-
readAttributesFromXml
public void readAttributesFromXml(EwsServiceXmlReader reader) throws Exception
Reads the attribute from XML.- Overrides:
readAttributesFromXmlin classComplexProperty- Parameters:
reader- the reader- Throws:
Exception- the exception
-
writeAttributesToXml
public void writeAttributesToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException
Writes the attribute to XML.- Overrides:
writeAttributesToXmlin classComplexProperty- Parameters:
writer- the writer- Throws:
ServiceXmlSerializationException- the service xml serialization exception
-
tryReadElementFromXml
public boolean tryReadElementFromXml(EwsServiceXmlReader reader) throws Exception
Tries to read element from XML.- Overrides:
tryReadElementFromXmlin classComplexProperty- Parameters:
reader- the reader- Returns:
- True if element was read.
- Throws:
Exception- the exception
-
loadFromXml
public void loadFromXml(EwsServiceXmlReader reader) throws Exception
Loads from XML.- Parameters:
reader- the reader- Throws:
Exception- the exception
-
writeElementsToXml
public void writeElementsToXml(EwsServiceXmlWriter writer) throws Exception
Writes elements to XML.- Overrides:
writeElementsToXmlin classComplexProperty- Parameters:
writer- the writer- Throws:
Exception- the exception
-
writeToXml
protected void writeToXml(EwsServiceXmlWriter writer) throws Exception
Writes to XML.- Parameters:
writer- The writer.- Throws:
Exception- the exception
-
validate
public void validate() throws ServiceLocalException
Validates this time zone definition.- Specified by:
validatein interfaceISelfValidate- Overrides:
validatein classComplexProperty- Throws:
InvalidOrUnsupportedTimeZoneDefinitionException- thrown when time zone definition is not valid.ServiceValidationException- the service validation exceptionServiceLocalException
-
getPeriods
public Map<String,TimeZonePeriod> getPeriods()
Adds a transition group with a single transition to the specified period.- Returns:
- A TimeZoneTransitionGroup.
-
getTransitionGroups
public Map<String,TimeZoneTransitionGroup> getTransitionGroups()
Gets the transition groups associated with this time zone definition, indexed by Id.- Returns:
- the transition groups
-
writeToXml
public void writeToXml(EwsServiceXmlWriter writer, String xmlElementName) throws Exception
Writes to XML.- Overrides:
writeToXmlin classComplexProperty- Parameters:
writer- accepts EwsServiceXmlWriterxmlElementName- accepts String- Throws:
Exception- throws Exception
-
-