public class FreeBusy extends ICalProperty
Defines a person's availability over certain time periods (for example, "busy" between 1pm-3pm and 4pm-5pm). Note that this property can contain multiple time periods, but only one availability type may be defined (e.g. "busy" or "free").
Code sample:
VFreeBusy fb = new VFreeBusy(); FreeBusy freebusy = new FreeBusy(); freebusy.setType(FreeBusyType.BUSY); Date onePM = ... Date threePM = ... freebusy.addValue(onePM, threePM); Date fourPM = ... Duration oneHour = Duration.builder().hours(1).build(); freeBusy.addValue(fourPM, oneHour); fb.addFreeBusy(freebusy);
parameters
Constructor and Description |
---|
FreeBusy() |
Modifier and Type | Method and Description |
---|---|
void |
addValue(Date start,
Date end)
Adds a time period.
|
void |
addValue(Date start,
Duration duration)
Adds a time period.
|
FreeBusyType |
getType()
Gets the person's status over the time periods that are specified in this
property (for example, "free" or "busy").
|
List<Period> |
getValues()
Gets all time periods.
|
void |
setType(FreeBusyType fbType)
Sets the person's status over the time periods that are specified in this
property (for example, "free" or "busy").
|
protected void |
validate(List<ICalComponent> components,
ICalVersion version,
List<Warning> warnings)
Checks the property for data consistency problems or deviations from the
spec.
|
addParameter, getParameter, getParameters, getParameters, removeParameter, setParameter, setParameter, setParameters, validate
public FreeBusy()
public void addValue(Date start, Date end)
start
- the start dateend
- the end datepublic void addValue(Date start, Duration duration)
start
- the start dateduration
- the durationpublic FreeBusyType getType()
public void setType(FreeBusyType fbType)
fbType
- the type or null to removeprotected void validate(List<ICalComponent> components, ICalVersion version, List<Warning> warnings)
ICalProperty
Checks the property 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 ICalProperty
components
- the hierarchy of components that the property belongs
toversion
- the version to validate againstwarnings
- the list to add the warnings toCopyright © 2013-2015 Michael Angstadt. All Rights Reserved.