public class

When

extends Element
java.lang.Object
   ↳ com.google.gdata.model.Element
     ↳ com.google.gdata.model.gd.When

Class Overview

Describes a period of time.

Summary

Fields
public static final AttributeKey<DateTime> END_TIME Event end time.
public static final ElementKey<Void, When> KEY The key for this element.
public static final AttributeKey<DateTime> START_TIME Event start time.
public static final AttributeKey<String> VALUE_STRING String description of the event times.
[Expand]
Inherited Fields
From class com.google.gdata.model.Element
Public Constructors
When()
Constructs an instance using the default key.
Protected Constructors
When(ElementKey<?, ? extends When> key)
Subclass constructor, allows subclasses to supply their own element key.
When(ElementKey<?, ? extends When> key, Element source)
Constructs a new instance by doing a shallow copy of data from an existing Element instance.
Public Methods
When addReminder(Reminder reminder)
Adds a new event reminder.
void clearReminder()
Removes all existing event reminder instances.
DateTime getEndTime()
Returns the event end time.
List<Reminder> getReminder()
Returns the event reminders.
DateTime getStartTime()
Returns the event start time.
String getValueString()
Returns the string description of the event times.
boolean hasEndTime()
Returns whether it has the event end time.
boolean hasReminder()
Returns whether it has the event reminders.
boolean hasStartTime()
Returns whether it has the event start time.
boolean hasValueString()
Returns whether it has the string description of the event times.
When lock()
Locks this element.
static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.
boolean removeReminder(Reminder reminder)
Removes an existing event reminder.
When setEndTime(DateTime endTime)
Sets the event end time.
When setStartTime(DateTime startTime)
Sets the event start time.
When setValueString(String valueString)
Sets the string description of the event times.
[Expand]
Inherited Methods
From class com.google.gdata.model.Element
From class java.lang.Object

Fields

public static final AttributeKey<DateTime> END_TIME

Event end time.

public static final ElementKey<Void, When> KEY

The key for this element.

public static final AttributeKey<DateTime> START_TIME

Event start time.

public static final AttributeKey<String> VALUE_STRING

String description of the event times.

Public Constructors

public When ()

Constructs an instance using the default key.

Protected Constructors

protected When (ElementKey<?, ? extends When> key)

Subclass constructor, allows subclasses to supply their own element key.

Parameters
key

protected When (ElementKey<?, ? extends When> key, Element source)

Constructs a new instance by doing a shallow copy of data from an existing Element instance. Will use the given ElementKey as the key for the element. This constructor is used when adapting from one element key to another. You cannot call this constructor directly, instead use createElement(ElementKey, Element).

Parameters
key The key to use for this element.
source Source element

Public Methods

public When addReminder (Reminder reminder)

Adds a new event reminder.

Parameters
reminder Event reminder

public void clearReminder ()

Removes all existing event reminder instances.

public DateTime getEndTime ()

Returns the event end time.

Returns
  • event end time

public List<Reminder> getReminder ()

Returns the event reminders.

Returns
  • event reminders

public DateTime getStartTime ()

Returns the event start time.

Returns
  • event start time

public String getValueString ()

Returns the string description of the event times.

Returns
  • string description of the event times

public boolean hasEndTime ()

Returns whether it has the event end time.

Returns
  • whether it has the event end time

public boolean hasReminder ()

Returns whether it has the event reminders.

Returns
  • whether it has the event reminders

public boolean hasStartTime ()

Returns whether it has the event start time.

Returns
  • whether it has the event start time

public boolean hasValueString ()

Returns whether it has the string description of the event times.

Returns
  • whether it has the string description of the event times

public When lock ()

Locks this element. A locked element cannot have any changes made to its content or its attributes or child elements. This will also lock all attributes and child elements as well. Once this method has been called, this element can be safely published to other threads.

public static void registerMetadata (MetadataRegistry registry)

Registers the metadata for this element.

Parameters
registry

public boolean removeReminder (Reminder reminder)

Removes an existing event reminder.

Parameters
reminder Event reminder
Returns
  • true if the reminder was removed

public When setEndTime (DateTime endTime)

Sets the event end time.

Parameters
endTime Event end time or null to reset
Returns
  • this to enable chaining setters

public When setStartTime (DateTime startTime)

Sets the event start time.

Parameters
startTime Event start time or null to reset
Returns
  • this to enable chaining setters

public When setValueString (String valueString)

Sets the string description of the event times.

Parameters
valueString String description of the event times or null to reset
Returns
  • this to enable chaining setters