microsoft.exchange.webservices.data.TimeSpanPropertyDefinition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of exchange-ws-api Show documentation
Show all versions of exchange-ws-api Show documentation
The source came from http://archive.msdn.microsoft.com/ewsjavaapi
Support for Maven has been added.
The newest version!
/**************************************************************************
* copyright file="TimeSpanPropertyDefinition.java" company="Microsoft"
* Copyright (c) Microsoft Corporation. All rights reserved.
*
* Defines the TimeSpanPropertyDefinition.java.
**************************************************************************/
package microsoft.exchange.webservices.data;
import java.util.EnumSet;
/**
* Represents TimeSpan property definition.
*/
class TimeSpanPropertyDefinition extends GenericPropertyDefinition {
/**
* Initializes a new instance of the "TimeSpanPropertyDefinition" class.
*
* @param xmlElementName
* Name of the XML element.
* @param uri
* The URI.
* @param flags
* The flags.
* @param version
* The version.
*/
protected TimeSpanPropertyDefinition(String xmlElementName, String uri,
EnumSet flags, ExchangeVersion version) {
super(TimeSpan.class, xmlElementName, uri, flags, version);
}
/***
* Parses the specified value.
*
* @param value
* The value.
* @return Typed value.
*/
@Override
protected Object parse(String value) {
return EwsUtilities.getXSDurationToTimeSpanValue(value);
}
/***
* Convert instance to string.
*
* @param value
* The value.
* @return String representation of property value.
*/
@Override
protected String toString(Object value) {
return EwsUtilities.getTimeSpanToXSDuration((TimeSpan)value);
}
}