public class VFreeBusy extends ICalComponent
Defines a collection of time ranges that describe when a person is available and 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);
components, properties
Constructor and Description |
---|
VFreeBusy()
Creates a new free/busy component.
|
Modifier and Type | Method and Description |
---|---|
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,
ICalVersion version,
List<Warning> warnings)
Checks the component for data consistency problems or deviations from the
spec.
|
addComponent, addExperimentalComponent, addExperimentalProperty, addExperimentalProperty, addProperty, checkOptionalCardinality, checkRequiredCardinality, checkStatus, getComponent, getComponents, getComponents, getExperimentalComponent, getExperimentalComponents, getExperimentalComponents, getExperimentalProperties, getExperimentalProperties, getExperimentalProperty, getProperties, getProperties, getProperty, removeComponents, removeExperimentalComponents, removeExperimentalProperty, removeProperties, setComponent, setComponent, setExperimentalComponents, setExperimentalProperty, setExperimentalProperty, setProperty, setProperty, validate
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:
Uid
- Set to a UUID.DateTimeStamp
- Set to the current date-time.public Uid getUid()
public void setUid(Uid uid)
uid
- the UID or null to removepublic Uid setUid(String uid)
uid
- the UID or null to removepublic DateTimeStamp getDateTimeStamp()
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.public void setDateTimeStamp(DateTimeStamp dateTimeStamp)
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.dateTimeStamp
- the date time stamp or null to removepublic DateTimeStamp setDateTimeStamp(Date dateTimeStamp)
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.dateTimeStamp
- the date time stamp or null to removepublic Contact getContact()
public void setContact(Contact contact)
contact
- the contact or null to removepublic Contact addContact(String contact)
contact
- the contact (e.g. "ACME Co - (123) 555-1234")public DateStart getDateStart()
public void setDateStart(DateStart dateStart)
dateStart
- the start date or null to removepublic DateStart setDateStart(Date dateStart)
dateStart
- the start date or null to removepublic DateEnd getDateEnd()
public void setDateEnd(DateEnd dateEnd)
dateEnd
- the end date or null to removepublic DateEnd setDateEnd(Date dateEnd)
dateEnd
- the end date or null to removepublic Organizer getOrganizer()
public void setOrganizer(Organizer organizer)
organizer
- the person requesting the free/busy time or null to
removepublic Organizer setOrganizer(String email)
email
- the email address of the person requesting the free/busy
time (e.g. "johndoe@example.com") or null to removepublic Url getUrl()
public void setUrl(Url url)
url
- the URL or null to removepublic Url setUrl(String url)
url
- the URL (e.g. "http://example.com/resource.ics") or null to
removepublic List<Attendee> getAttendees()
public void addAttendee(Attendee attendee)
attendee
- the attendeepublic List<Comment> getComments()
public void addComment(Comment comment)
comment
- the comment to addpublic Comment addComment(String comment)
comment
- the comment to addpublic List<FreeBusy> getFreeBusy()
public void addFreeBusy(FreeBusy freeBusy)
FreeBusy
property can contain multiple time periods, but only one
availability type (e.g. "busy").freeBusy
- the availabilitiespublic FreeBusy addFreeBusy(FreeBusyType type, Date start, Date end)
FreeBusyType
and add the time period
to it, or create a new property is one cannot be found.type
- the availability type (e.g. "free" or "busy")start
- the start date-timeend
- the end date-timepublic FreeBusy addFreeBusy(FreeBusyType type, Date start, Duration duration)
FreeBusyType
and add the
time period to it, or create a new property is one cannot be found.type
- the availability type (e.g. "free" or "busy")start
- the start date-timeduration
- the length of timepublic RequestStatus getRequestStatus()
public void setRequestStatus(RequestStatus requestStatus)
requestStatus
- the responseprotected void validate(List<ICalComponent> components, ICalVersion version, List<Warning> warnings)
ICalComponent
Checks the component for data consistency problems or deviations from the spec.
This method should be overridden by child classes that wish to provide validation logic. The default implementation of this method does nothing.
validate
in class ICalComponent
components
- the hierarchy of components that the component belongs
toversion
- the version to validate againstwarnings
- the list to add the warnings toCopyright © 2013-2015 Michael Angstadt. All Rights Reserved.