001/*
002 * The MIT License
003 * Copyright (c) 2012 Microsoft Corporation
004 *
005 * Permission is hereby granted, free of charge, to any person obtaining a copy
006 * of this software and associated documentation files (the "Software"), to deal
007 * in the Software without restriction, including without limitation the rights
008 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
009 * copies of the Software, and to permit persons to whom the Software is
010 * furnished to do so, subject to the following conditions:
011 *
012 * The above copyright notice and this permission notice shall be included in
013 * all copies or substantial portions of the Software.
014 *
015 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
016 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
017 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
018 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
019 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
020 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
021 * THE SOFTWARE.
022 */
023
024package microsoft.exchange.webservices.data.property.complex.availability;
025
026import microsoft.exchange.webservices.data.core.EwsServiceXmlReader;
027import microsoft.exchange.webservices.data.core.XmlElementNames;
028import microsoft.exchange.webservices.data.property.complex.ComplexProperty;
029
030/**
031 * Represents the details of a calendar event as returned by the
032 * GetUserAvailability operation.
033 */
034public final class CalendarEventDetails extends ComplexProperty {
035
036  /**
037   * The store id.
038   */
039  private String storeId;
040
041  /**
042   * The subject.
043   */
044  private String subject;
045
046  /**
047   * The location.
048   */
049  private String location;
050
051  /**
052   * The is meeting.
053   */
054  private boolean isMeeting;
055
056  /**
057   * The is recurring.
058   */
059  private boolean isRecurring;
060
061  /**
062   * The is exception.
063   */
064  private boolean isException;
065
066  /**
067   * The is reminder set.
068   */
069  private boolean isReminderSet;
070
071  /**
072   * The is private.
073   */
074  private boolean isPrivate;
075
076  /**
077   * Initializes a new instance of the CalendarEventDetails class.
078   */
079  protected CalendarEventDetails() {
080    super();
081  }
082
083  /**
084   * Attempts to read the element at the reader's current position.
085   *
086   * @param reader the reader
087   * @return True if the element was read, false otherwise.
088   * @throws Exception the exception
089   */
090  @Override
091  public boolean tryReadElementFromXml(EwsServiceXmlReader reader)
092      throws Exception {
093    if (reader.getLocalName().equals(XmlElementNames.ID)) {
094      this.storeId = reader.readElementValue();
095      return true;
096    } else if (reader.getLocalName().equals(XmlElementNames.Subject)) {
097      this.subject = reader.readElementValue();
098      return true;
099    } else if (reader.getLocalName().equals(XmlElementNames.Location)) {
100      this.location = reader.readElementValue();
101      return true;
102    } else if (reader.getLocalName().equals(XmlElementNames.IsMeeting)) {
103      this.isMeeting = reader.readElementValue(Boolean.class);
104      return true;
105    } else if (reader.getLocalName().equals(XmlElementNames.IsRecurring)) {
106      this.isRecurring = reader.readElementValue(Boolean.class);
107      return true;
108    } else if (reader.getLocalName().equals(XmlElementNames.IsException)) {
109      this.isException = reader.readElementValue(Boolean.class);
110      return true;
111    } else if (reader.getLocalName().equals(XmlElementNames.IsReminderSet)) {
112
113      this.isReminderSet = reader.readElementValue(Boolean.class);
114      return true;
115    } else if (reader.getLocalName().equals(XmlElementNames.IsPrivate)) {
116      this.isPrivate = reader.readElementValue(Boolean.class);
117      return true;
118    } else {
119      return false;
120    }
121
122  }
123
124  /**
125   * Gets the store Id of the calendar event.
126   *
127   * @return the store id
128   */
129  public String getStoreId() {
130    return this.storeId;
131  }
132
133  /**
134   * Gets the subject of the calendar event.
135   *
136   * @return the subject
137   */
138  public String getSubject() {
139    return subject;
140  }
141
142  /**
143   * Gets the location of the calendar event.
144   *
145   * @return the location
146   */
147  public String getLocation() {
148    return location;
149  }
150
151  /**
152   * Gets a value indicating whether the calendar event is a meeting.
153   *
154   * @return true, if is meeting
155   */
156  public boolean isMeeting() {
157    return isMeeting;
158  }
159
160  /**
161   * Gets a value indicating whether the calendar event is recurring.
162   *
163   * @return true, if is recurring
164   */
165  public boolean isRecurring() {
166    return isRecurring;
167  }
168
169  /**
170   * Gets a value indicating whether the calendar event is an exception in a
171   * recurring series.
172   *
173   * @return true, if is exception
174   */
175  public boolean isException() {
176    return isException;
177  }
178
179  /**
180   * Gets a value indicating whether the calendar event has a reminder set.
181   *
182   * @return true, if is reminder set
183   */
184  public boolean isReminderSet() {
185    return isReminderSet;
186  }
187
188  /**
189   * Gets a value indicating whether the calendar event is private.
190   *
191   * @return true, if is private
192   */
193  public boolean isPrivate() {
194    return isPrivate;
195  }
196
197}