public class Reservation extends AbstractIdentifiedHibernateObject<Reservation> implements Cloneable, Auditable
id
Constructor and Description |
---|
Reservation() |
Modifier and Type | Method and Description |
---|---|
Reservation |
clone() |
int |
getChairs() |
Date |
getCreated_at()
Set on creation
|
String |
getCustomer() |
String |
getDescription() |
static Date |
getEndTime(int startSlot,
int numSlots,
int slotLength)
Calculate the end time of a reservation period
|
static int |
getNextSlot(Date time,
int slotLength)
Like getSlot but returns the next slot.
|
Date |
getReservationDate() |
static int |
getReservedChairs(Date startTime,
int slotLength,
int slots)
Return the number of reserved seats in a given time interval.
|
String |
getResource_id() |
String |
getResourceType() |
static int |
getSlot(Date time,
int slotLength)
Calculate the slot number for a given date and slot length.
|
Integer |
getSlotLength() |
Integer |
getSlots() |
static Date |
getStartTime(int startSlot,
int slotLength)
The start time is only calculated from the slot number and the slot length.
|
TicketLine |
getTicketline() |
Date |
getUpdated_at()
Last updated or created
|
boolean |
isDone() |
void |
setChairs(int chairs) |
void |
setCreated_at(Date created_at)
Set on creation
|
void |
setCustomer(String customer) |
void |
setDescription(String description) |
void |
setDone(boolean done) |
void |
setReservationDate(Date reservationDate) |
void |
setResource_id(String resource_id) |
void |
setResourceType(String resourceType) |
void |
setSlotLength(Integer slotLength) |
void |
setSlots(Integer slots) |
void |
setTicketline(TicketLine ticketline) |
void |
setUpdated_at(Date updated_at)
Set when item is created or updated
|
equals, getId, getVersion, hashCode, setId, setVersion
delete, getGetters, getKeyValue, merge, refresh, save
public TicketLine getTicketline()
public void setTicketline(TicketLine ticketline)
public String getCustomer()
public void setCustomer(String customer)
public Date getReservationDate()
public void setReservationDate(Date reservationDate)
public String getDescription()
public void setDescription(String description)
public boolean isDone()
public void setDone(boolean done)
public int getChairs()
public void setChairs(int chairs)
public String getResourceType()
public void setResourceType(String resourceType)
public String getResource_id()
public void setResource_id(String resource_id)
public Integer getSlotLength()
public void setSlotLength(Integer slotLength)
public Integer getSlots()
public void setSlots(Integer slots)
public static int getSlot(Date time, int slotLength)
time
- The time component of the given date will be evaluatedslotLength
- public Date getCreated_at()
public void setCreated_at(Date created_at)
setCreated_at
in interface Auditable
created_at
- The current date at creationpublic Date getUpdated_at()
public void setUpdated_at(Date updated_at)
setUpdated_at
in interface Auditable
updated_at
- Current date at updatepublic static int getNextSlot(Date time, int slotLength)
time
- slotLength
- public static Date getEndTime(int startSlot, int numSlots, int slotLength)
startSlot
- numSlots
- slotLength
- public static Date getStartTime(int startSlot, int slotLength)
startSlot
- slotLength
- public Reservation clone()
public static int getReservedChairs(Date startTime, int slotLength, int slots)
startTime
- as DateslotLength
- in mmiutes as intslots
- number of slots to considerCopyright © 2021. All rights reserved.