Package de.xima.fc.entities
Class AppointmentSlot
- java.lang.Object
-
- de.xima.cmn.dao.model.AEntity<Long>
-
- de.xima.fc.entities.AbstractEntity
-
- de.xima.fc.entities.AbstractLockableEntity
-
- de.xima.fc.entities.AppointmentSlot
-
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IEntity<Long>
,de.xima.cmn.dao.interfaces.ILockableEntity<Long>
,ILockingVersionProviding
,ITransferable
,ITransferableEntity
,ITransferableLockableEntity
,Serializable
,Comparable<de.xima.cmn.dao.interfaces.IEntity<Long>>
@Entity public class AppointmentSlot extends AbstractLockableEntity
Describes an available slot (time range) of anAppointmentTemplate
.- Since:
- 6.5.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_APPOINTMENT_TEMPLATE
JPA attribute name for thegetAppointmentTemplate()
field.static String
ATTR_DAY_OF_WEEK
JPA attribute name for thegetDayOfWeek()
field.static String
ATTR_TIME_FROM
JPA attribute name for thegetTimeFrom()
field.static String
ATTR_TIME_UNTIL
JPA attribute name for thegetTimeUntil()
field.static String
COL_APPOINTMENT_TEMPLATE
Database column name for thegetAppointmentTemplate()
field.static String
COL_DAY_OF_WEEK
Database column name for thegetDayOfWeek()
field.static String
COL_TIME_FROM
Database column name for thegetTimeFrom()
field.static String
COL_TIME_UNTIL
Database column name for thegetTimeUntil()
field.-
Fields inherited from class de.xima.fc.entities.AbstractLockableEntity
COL_LOCKINGVERSION, lockingVersion
-
Fields inherited from class de.xima.fc.entities.AbstractEntity
COL_ID, id
-
Fields inherited from interface de.xima.fc.entities.interfaces.ITransferableEntity
IMPORT_ID, INVALID_ID
-
-
Constructor Summary
Constructors Constructor Description AppointmentSlot()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AppointmentTemplate
getAppointmentTemplate()
DayOfWeek
getDayOfWeek()
Long
getId()
String
getKey()
com.google.common.collect.Range<LocalTime>
getTime()
LocalTime
getTimeFrom()
LocalTime
getTimeUntil()
void
setAppointmentTemplate(AppointmentTemplate appointmentTemplate)
void
setDayOfWeek(DayOfWeek dayOfWeek)
void
setTimeFrom(int hours, int minutes)
Sets the start time of this appointment slot, on thegetDayOfWeek()
.void
setTimeFrom(LocalTime timeFrom)
void
setTimeUntil(int hours, int minutes)
Sets the end time of this appointment slot, on thegetDayOfWeek()
.void
setTimeUntil(LocalTime timeUntil)
-
Methods inherited from class de.xima.fc.entities.AbstractLockableEntity
entityHasChanged, getLockingVersion, setLockingVersion, toString
-
Methods inherited from class de.xima.fc.entities.AbstractEntity
asIntValue, isPersisted, setId, setId
-
Methods inherited from class de.xima.cmn.dao.model.AEntity
compareTo, equals, getDBTableName, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Field Detail
-
ATTR_APPOINTMENT_TEMPLATE
public static final String ATTR_APPOINTMENT_TEMPLATE
JPA attribute name for thegetAppointmentTemplate()
field.- See Also:
- Constant Field Values
-
ATTR_DAY_OF_WEEK
public static final String ATTR_DAY_OF_WEEK
JPA attribute name for thegetDayOfWeek()
field.- See Also:
- Constant Field Values
-
ATTR_TIME_FROM
public static final String ATTR_TIME_FROM
JPA attribute name for thegetTimeFrom()
field.- See Also:
- Constant Field Values
-
ATTR_TIME_UNTIL
public static final String ATTR_TIME_UNTIL
JPA attribute name for thegetTimeUntil()
field.- See Also:
- Constant Field Values
-
COL_APPOINTMENT_TEMPLATE
public static final String COL_APPOINTMENT_TEMPLATE
Database column name for thegetAppointmentTemplate()
field.- See Also:
- Constant Field Values
-
COL_DAY_OF_WEEK
public static final String COL_DAY_OF_WEEK
Database column name for thegetDayOfWeek()
field.- See Also:
- Constant Field Values
-
COL_TIME_FROM
public static final String COL_TIME_FROM
Database column name for thegetTimeFrom()
field.- See Also:
- Constant Field Values
-
COL_TIME_UNTIL
public static final String COL_TIME_UNTIL
Database column name for thegetTimeUntil()
field.- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public Long getId()
-
getAppointmentTemplate
public AppointmentTemplate getAppointmentTemplate()
- Returns:
- The appointment template for which this slot was created.
-
getDayOfWeek
public DayOfWeek getDayOfWeek()
- Returns:
- The week day of this slot, from Monday to Sunday. Each slot can be assigned to one day only.
-
getKey
public String getKey()
- Returns:
- A unique ID of this appointment slot. Two appointment slots objects are equal if and only if their IDs are equal.
-
getTime
public com.google.common.collect.Range<LocalTime> getTime()
- Returns:
- The start and end time of this appointment slot, on the
getDayOfWeek()
. This is in the time zone defined by correspondingAppointmentTemplate.getZoneId()
(seegetAppointmentTemplate()
.
-
getTimeFrom
public LocalTime getTimeFrom()
- Returns:
- The start of this appointment slot, on the
getDayOfWeek()
. This is in the time zone defined by correspondingAppointmentTemplate.getZoneId()
(seegetAppointmentTemplate()
.
-
getTimeUntil
public LocalTime getTimeUntil()
- Returns:
- The end time of this appointment slot, on the
getDayOfWeek()
. This is in the time zone defined by correspondingAppointmentTemplate.getZoneId()
(seegetAppointmentTemplate()
.
-
setAppointmentTemplate
public void setAppointmentTemplate(AppointmentTemplate appointmentTemplate)
- Parameters:
appointmentTemplate
- The appointment template for which this slot was created.
-
setDayOfWeek
public void setDayOfWeek(DayOfWeek dayOfWeek)
- Parameters:
dayOfWeek
- The week day of this slot, from Monday to Sunday. Each slot can be assigned to one day only.
-
setTimeFrom
public void setTimeFrom(int hours, int minutes)
Sets the start time of this appointment slot, on thegetDayOfWeek()
. This is in the time zone defined by correspondingAppointmentTemplate.getZoneId()
(seegetAppointmentTemplate()
.- Parameters:
hours
- The hours part of the start time of this slot.minutes
- The minutes part of the start time of this slot.s
-
setTimeFrom
public void setTimeFrom(LocalTime timeFrom)
- Parameters:
timeFrom
- The start time of this appointment slot, on thegetDayOfWeek()
. This is in the time zone defined by correspondingAppointmentTemplate.getZoneId()
(seegetAppointmentTemplate()
.
-
setTimeUntil
public void setTimeUntil(int hours, int minutes)
Sets the end time of this appointment slot, on thegetDayOfWeek()
. This is in the time zone defined by correspondingAppointmentTemplate.getZoneId()
(seegetAppointmentTemplate()
.- Parameters:
hours
- The hours part of the end time of this slot.minutes
- The minutes part of the end time of this slot.s
-
setTimeUntil
public void setTimeUntil(LocalTime timeUntil)
- Parameters:
timeUntil
- The start of this appointment slot, on thegetDayOfWeek()
. This is in the time zone defined by correspondingAppointmentTemplate.getZoneId()
(seegetAppointmentTemplate()
.
-
-