biweekly.component
Class VFreeBusy

java.lang.Object
  extended by biweekly.component.ICalComponent
      extended by biweekly.component.VFreeBusy

public class VFreeBusy
extends ICalComponent

Defines a collection of time ranges that describe when the person is available or unavailable.

Examples:

 VFreeBusy freebusy = new VFreeBusy();
 
 Date start = ...
 Date end = ...
 freebusy.addFreeBusy(FreeBusyType.FREE, start, end);
 
 start = ...
 Duration duration = Duration.builder().hours(2).build();
 freebusy.addFreeBusy(FreeBusyType.BUSY, start, duration);
 

Author:
Michael Angstadt
Specification Reference:
RFC 5545 p.59-62

Field Summary
 
Fields inherited from class biweekly.component.ICalComponent
components, properties
 
Constructor Summary
VFreeBusy()
           Creates a new free/busy component.
 
Method Summary
 void addAttendee(Attendee attendee)
          Adds a person who is involved in the free/busy entry.
 void addComment(Comment comment)
          Adds a comment to the free/busy entry.
 Comment addComment(String comment)
          Adds a comment to the free/busy entry.
 Contact addContact(String contact)
          Sets the contact for the free/busy entry.
 void addFreeBusy(FreeBusy freeBusy)
          Adds a list of time periods for which the person is free or busy (for example, "free" between 1pm-3pm and 4pm-5pm).
 FreeBusy addFreeBusy(FreeBusyType type, Date start, Date end)
          Adds a single time period for which the person is free or busy (for example, "free" between 1pm-3pm).
 FreeBusy addFreeBusy(FreeBusyType type, Date start, Duration duration)
          Adds a single time period for which the person is free or busy (for example, "free" for 2 hours after 1pm).
 List<Attendee> getAttendees()
          Gets the people who are involved in the free/busy entry.
 List<Comment> getComments()
          Gets the comments attached to the free/busy entry.
 Contact getContact()
          Gets the contact associated with the free/busy entry.
 DateEnd getDateEnd()
          Gets the date that the free/busy entry ends.
 DateStart getDateStart()
          Gets the date that the free/busy entry starts.
 DateTimeStamp getDateTimeStamp()
          Gets either (a) the creation date of the iCalendar object (if the Method property is defined) or (b) the date that the free/busy entry was last modified (the LastModified property also holds this information).
 List<FreeBusy> getFreeBusy()
          Gets the person's availabilities over certain time periods (for example, "free" between 1pm-3pm, but "busy" between 3pm-4pm).
 Organizer getOrganizer()
          Gets the person requesting the free/busy time.
 RequestStatus getRequestStatus()
          Gets the response to a scheduling request.
 Uid getUid()
          Gets the unique identifier for this free/busy entry.
 Url getUrl()
          Gets a URL to a resource that contains additional information about the free/busy entry.
 void setContact(Contact contact)
          Sets the contact for the free/busy entry.
 DateEnd setDateEnd(Date dateEnd)
          Sets the date that the free/busy entry ends.
 void setDateEnd(DateEnd dateEnd)
          Sets the date that the free/busy entry ends.
 DateStart setDateStart(Date dateStart)
          Sets the date that the free/busy entry starts.
 void setDateStart(DateStart dateStart)
          Sets the date that the free/busy entry starts.
 DateTimeStamp setDateTimeStamp(Date dateTimeStamp)
          Sets either (a) the creation date of the iCalendar object (if the Method property is defined) or (b) the date that the free/busy entry was last modified (the LastModified property also holds this information).
 void setDateTimeStamp(DateTimeStamp dateTimeStamp)
          Sets either (a) the creation date of the iCalendar object (if the Method property is defined) or (b) the date that the free/busy entry was last modified (the LastModified property also holds this information).
 void setOrganizer(Organizer organizer)
          Sets the person requesting the free/busy time.
 Organizer setOrganizer(String email)
          Sets the person requesting the free/busy time.
 void setRequestStatus(RequestStatus requestStatus)
          Sets the response to a scheduling request.
 Uid setUid(String uid)
          Sets the unique identifier for this free/busy entry.
 void setUid(Uid uid)
          Sets the unique identifier for this free/busy entry.
 Url setUrl(String url)
          Sets a URL to a resource that contains additional information about the free/busy entry.
 void setUrl(Url url)
          Sets a URL to a resource that contains additional information about the free/busy entry.
protected  void validate(List<ICalComponent> components, List<String> warnings)
          Checks the component for data consistency problems or deviations from the spec.
 
Methods inherited from class biweekly.component.ICalComponent
addComponent, addExperimentalComponent, addExperimentalProperty, addExperimentalProperty, addProperty, checkOptionalCardinality, checkRequiredCardinality, getComponent, getComponents, getComponents, getExperimentalComponent, getExperimentalComponents, getExperimentalComponents, getExperimentalProperties, getExperimentalProperties, getExperimentalProperty, getProperties, getProperties, getProperty, removeExperimentalComponents, removeExperimentalProperty, removeProperties, setComponent, setComponent, setExperimentalComponents, setExperimentalProperty, setExperimentalProperty, setProperty, setProperty, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VFreeBusy

public VFreeBusy()

Creates a new free/busy component.

The following properties are auto-generated on object creation. These properties must be present in order for the free/busy component to be valid:

Method Detail

getUid

public Uid getUid()
Gets the unique identifier for this free/busy entry. This component object comes populated with a UID on creation. This is a required property.

Returns:
the UID or null if not set
Specification Reference:
RFC 5545 p.117-8

setUid

public void setUid(Uid uid)
Sets the unique identifier for this free/busy entry. This component object comes populated with a UID on creation. This is a required property.

Parameters:
uid - the UID or null to remove
Specification Reference:
RFC 5545 p.117-8

setUid

public Uid setUid(String uid)
Sets the unique identifier for this free/busy entry. This component object comes populated with a UID on creation. This is a required property.

Parameters:
uid - the UID or null to remove
Returns:
the property that was created
Specification Reference:
RFC 5545 p.117-8

getDateTimeStamp

public DateTimeStamp getDateTimeStamp()
Gets either (a) the creation date of the iCalendar object (if the Method property is defined) or (b) the date that the free/busy entry was last modified (the LastModified property also holds this information). This free/busy object comes populated with a DateTimeStamp property that is set to the current time. This is a required property.

Returns:
the date time stamp or null if not set
Specification Reference:
RFC 5545 p.137-8

setDateTimeStamp

public void setDateTimeStamp(DateTimeStamp dateTimeStamp)
Sets either (a) the creation date of the iCalendar object (if the Method property is defined) or (b) the date that the free/busy entry was last modified (the LastModified property also holds this information). This free/busy object comes populated with a DateTimeStamp property that is set to the current time. This is a required property.

Parameters:
dateTimeStamp - the date time stamp or null to remove
Specification Reference:
RFC 5545 p.137-8

setDateTimeStamp

public DateTimeStamp setDateTimeStamp(Date dateTimeStamp)
Sets either (a) the creation date of the iCalendar object (if the Method property is defined) or (b) the date that the free/busy entry was last modified (the LastModified property also holds this information). This free/busy object comes populated with a DateTimeStamp property that is set to the current time. This is a required property.

Parameters:
dateTimeStamp - the date time stamp or null to remove
Returns:
the property that was created
Specification Reference:
RFC 5545 p.137-8

getContact

public Contact getContact()
Gets the contact associated with the free/busy entry.

Returns:
the contact or null if not set
Specification Reference:
RFC 5545 p.109-11

setContact

public void setContact(Contact contact)
Sets the contact for the free/busy entry.

Parameters:
contact - the contact or null to remove
Specification Reference:
RFC 5545 p.109-11

addContact

public Contact addContact(String contact)
Sets the contact for the free/busy entry.

Parameters:
contact - the contact (e.g. "ACME Co - (123) 555-1234")
Returns:
the property that was created
Specification Reference:
RFC 5545 p.109-11

getDateStart

public DateStart getDateStart()
Gets the date that the free/busy entry starts.

Returns:
the start date or null if not set
Specification Reference:
RFC 5545 p.97-8

setDateStart

public void setDateStart(DateStart dateStart)
Sets the date that the free/busy entry starts.

Parameters:
dateStart - the start date or null to remove
Specification Reference:
RFC 5545 p.97-8

setDateStart

public DateStart setDateStart(Date dateStart)
Sets the date that the free/busy entry starts.

Parameters:
dateStart - the start date or null to remove
Returns:
the property that was created
Specification Reference:
RFC 5545 p.97-8

getDateEnd

public DateEnd getDateEnd()
Gets the date that the free/busy entry ends.

Returns:
the end date or null if not set
Specification Reference:
RFC 5545 p.95-6

setDateEnd

public void setDateEnd(DateEnd dateEnd)
Sets the date that the free/busy entry ends.

Parameters:
dateEnd - the end date or null to remove
Specification Reference:
RFC 5545 p.95-6

setDateEnd

public DateEnd setDateEnd(Date dateEnd)
Sets the date that the free/busy entry ends.

Parameters:
dateEnd - the end date or null to remove
Returns:
the property that was created
Specification Reference:
RFC 5545 p.95-6

getOrganizer

public Organizer getOrganizer()
Gets the person requesting the free/busy time.

Returns:
the person requesting the free/busy time or null if not set
Specification Reference:
RFC 5545 p.111-2

setOrganizer

public void setOrganizer(Organizer organizer)
Sets the person requesting the free/busy time.

Parameters:
organizer - the person requesting the free/busy time or null to remove
Specification Reference:
RFC 5545 p.111-2

setOrganizer

public Organizer setOrganizer(String email)
Sets the person requesting the free/busy time.

Parameters:
email - the email address of the person requesting the free/busy time (e.g. "johndoe@example.com") or null to remove
Returns:
the property that was created
Specification Reference:
RFC 5545 p.111-2

getUrl

public Url getUrl()
Gets a URL to a resource that contains additional information about the free/busy entry.

Returns:
the URL or null if not set
Specification Reference:
RFC 5545 p.116-7

setUrl

public void setUrl(Url url)
Sets a URL to a resource that contains additional information about the free/busy entry.

Parameters:
url - the URL or null to remove
Specification Reference:
RFC 5545 p.116-7

setUrl

public Url setUrl(String url)
Sets a URL to a resource that contains additional information about the free/busy entry.

Parameters:
url - the URL (e.g. "http://example.com/resource.ics") or null to remove
Returns:
the property that was created
Specification Reference:
RFC 5545 p.116-7

getAttendees

public List<Attendee> getAttendees()
Gets the people who are involved in the free/busy entry.

Returns:
the attendees
Specification Reference:
RFC 5545 p.107-9

addAttendee

public void addAttendee(Attendee attendee)
Adds a person who is involved in the free/busy entry.

Parameters:
attendee - the attendee
Specification Reference:
RFC 5545 p.107-9

getComments

public List<Comment> getComments()
Gets the comments attached to the free/busy entry.

Returns:
the comments
Specification Reference:
RFC 5545 p.83-4

addComment

public void addComment(Comment comment)
Adds a comment to the free/busy entry.

Parameters:
comment - the comment to add
Specification Reference:
RFC 5545 p.83-4

addComment

public Comment addComment(String comment)
Adds a comment to the free/busy entry.

Parameters:
comment - the comment to add
Returns:
the property that was created
Specification Reference:
RFC 5545 p.83-4

getFreeBusy

public List<FreeBusy> getFreeBusy()
Gets the person's availabilities over certain time periods (for example, "free" between 1pm-3pm, but "busy" between 3pm-4pm).

Returns:
the availabilities
Specification Reference:
RFC 5545 p.100-1

addFreeBusy

public void addFreeBusy(FreeBusy freeBusy)
Adds a list of time periods for which the person is free or busy (for example, "free" between 1pm-3pm and 4pm-5pm). Note that a FreeBusy property can contain multiple time periods, but only one availability type (e.g. "busy").

Parameters:
freeBusy - the availabilities
Specification Reference:
RFC 5545 p.100-1

addFreeBusy

public FreeBusy addFreeBusy(FreeBusyType type,
                            Date start,
                            Date end)
Adds a single time period for which the person is free or busy (for example, "free" between 1pm-3pm). This method will look for an existing property that has the given FreeBusyType and add the time period to it, or create a new property is one cannot be found.

Parameters:
type - the availability type (e.g. "free" or "busy")
start - the start date-time
end - the end date-time
Returns:
the property that was created/modified
Specification Reference:
RFC 5545 p.100-1

addFreeBusy

public FreeBusy addFreeBusy(FreeBusyType type,
                            Date start,
                            Duration duration)
Adds a single time period for which the person is free or busy (for example, "free" for 2 hours after 1pm). This method will look for an existing property that has the given FreeBusyType and add the time period to it, or create a new property is one cannot be found.

Parameters:
type - the availability type (e.g. "free" or "busy")
start - the start date-time
duration - the length of time
Returns:
the property that was created/modified
Specification Reference:
RFC 5545 p.100-1

getRequestStatus

public RequestStatus getRequestStatus()
Gets the response to a scheduling request.

Returns:
the response
Specification Reference:
RFC 5545 p.141-3

setRequestStatus

public void setRequestStatus(RequestStatus requestStatus)
Sets the response to a scheduling request.

Parameters:
requestStatus - the response
Specification Reference:
RFC 5545 p.141-3

validate

protected void validate(List<ICalComponent> components,
                        List<String> warnings)
Description copied from class: ICalComponent
Checks the component for data consistency problems or deviations from the spec. Meant to be overridden by child classes.

Overrides:
validate in class ICalComponent
Parameters:
components - the hierarchy of components that the component belongs to
warnings - the list to add the warnings to


Copyright © 2013 Michael Angstadt. All Rights Reserved.